21+ years in hosting · Jaipur, India · INR billing with 18% GST · 24/7 email support
Blog · WebJi® India

How to Clone a WordPress Site

Quick answer

To clone a WordPress site, copy its files and database to a new folder or domain, point wp-config.php at the new database, then change the old URL with a serialized-aware tool such as Duplicator or wp search-replace. Take a backup first, and block search engines and payments on any staging copy.

For WordPress owners and developers creating staging copies, moving to a new domain or reusing a working build.

✓ In business since 2005
✓ INR + GST billing
✓ 24/7 Email Support — avg reply < 60 min
GuideWebJi®
knowledge
Read time
7 min
Sections
9
Updated
14 Nov 2026
Written by
WebJi® team

What does cloning a WordPress site copy?

A WordPress clone is a full copy of two things — the files (core, wp-content with themes, plugins and uploads) and the MySQL database (posts, users, menus, settings) — running at a new address. It does not move the domain registration, mailboxes or DNS records.

Clone to test a plugin or PHP upgrade on staging, to launch the same build on a new domain, or to start a new project from a working site. Take a full website backup first: the clone is what you experiment on, the backup is what you restore if anything goes wrong. Duplicating a single page in the block editor copies only that page.

Which method should you use to clone WordPress?

Use Duplicator to move a copy to another host or domain, All-in-One WP Migration for small sites, WP-CLI when you have SSH, and a panel clone button when both copies stay in one hosting account. Pick one and finish it; mixing tools leaves two half-copies.

WordPress cloning methods compared
MethodBest forWatch for
DuplicatorMoving to another host or domain; destination needs no WordPressDelete installer.php and the archive afterwards
All-in-One WP MigrationSmall sites, WordPress already installed at the destinationImport fails above the plugin’s size cap or PHP upload limits
Files + WP-CLISSH access, large sites, repeatable workflowURL replace must handle serialized data
Panel clone or staging buttonStaging inside the same hosting accountDoes not move the site off that account

Whichever you use, create an empty database and user on the destination first; the cPanel MySQL database guide shows how.

How do you clone WordPress with Duplicator?

Build a backup package on the source site, upload the archive and installer.php to the destination, then run installer.php with the new database details. The free version handles a complete single-site copy.

  1. Install Duplicator on the source site, open Duplicator → Backups and create a new backup named with the site and date.
  2. Run the scan, resolve any warning that would skip the database or uploads, then build.
  3. Download both files: the archive and installer.php.
  4. Upload both to the destination document root (or a subfolder for staging).
  5. Open https://new-host/installer.php, enter the new database name, user and password, and let it extract, import and replace URLs.
  6. Log in on the new hostname and remove the installer files when prompted.

How do you clone WordPress with All-in-One WP Migration?

Export a single .wpress file from the source, install fresh WordPress plus the same plugin at the destination, and import the file. Then go to Settings → Permalinks and click Save once so rewrite rules match the new address.

Imports stop when the file is bigger than the plugin’s own limit or PHP’s upload_max_filesize and post_max_size. Raise those limits as shown in increase the WordPress upload size, or switch to Duplicator or WP-CLI. The import overwrites the destination’s users, so log in with the source site’s credentials afterwards.

How do you clone WordPress manually with WP-CLI?

Copy the files, export and import the database, point wp-config.php at the new database, then run wp search-replace to change the URL everywhere, including serialized settings. This needs SSH access on both ends, or one server holding both copies.

# on the source
wp db export site.sql
rsync -a ~/public_html/ ~/staging/          # or copy to the new server with rsync over SSH

# on the destination, inside the new site folder
wp config set DB_NAME new_db
wp config set DB_USER new_user
wp config set DB_PASSWORD 'new_password'
wp db import site.sql
wp search-replace 'https://old-domain.com' 'https://new-domain.com' --all-tables --skip-columns=guid --dry-run
wp search-replace 'https://old-domain.com' 'https://new-domain.com' --all-tables --skip-columns=guid
wp cache flush && wp rewrite flush

Never swap the domain in the .sql file with a text editor. WordPress stores many options as serialized PHP, which records string lengths; a find-and-replace that changes the length corrupts menus, widgets and page-builder layouts while the homepage still looks fine. Without SSH, File Manager and phpMyAdmin can copy and import, but run the URL change with a serialized-aware tool.

How do you keep a staging clone out of Google and away from customers?

Tick Settings → Reading → “Discourage search engines from indexing this site”, add password protection to the staging hostname, and switch payment gateways and customer emails off before testing. The checkbox is only a request to search engines; a password actually blocks access.

  • Indexing: discourage search engines and never submit the staging hostname to Search Console.
  • Access: protect the folder or subdomain with the panel’s directory privacy (HTTP authentication).
  • Shops: put payment gateways in test mode and disable order emails, or a test order will charge a card and email a real customer.
  • Cron and integrations: pause scheduled exports, CRM syncs and newsletter sends on the copy.

WebJi® WordPress hosting lists staging on its WordPress Unlimited plans; on other plans, confirm with support@webji.services before promising a client one-click staging. WordPress staging site covers the workflow of pushing changes back.

What breaks a WordPress clone, and how do you fix it?

Most failed clones come from an incomplete upload, wp-config.php still pointing at the old database, or a URL replace that skipped or damaged serialized data. Match the symptom before starting over.

Clone symptoms, causes and fixes
SymptomUsual causeFix
installer.php blank or downloads as a filePartial upload, or PHP out of memory or timeRe-upload both files; raise memory_limit and max_execution_time
Error establishing a database connectionOld database name, user, password or host in wp-config.phpCorrect the four DB constants
Homepage works, menus or images brokenURL not replaced, or serialized rows damagedRe-import a clean dump; run wp search-replace
White screen only on the new hostOlder PHP version at the destinationMatch versions in the PHP selector
Redirects back to the old sitesiteurl/home unchanged, or cached redirectsCheck Settings → General; clear cache and browser

A clone you can open is not a backup. Keep restorable copies off the server with WebJi® WordPress backup.

FAQ

Frequently asked questions

Do I need to change anything if I clone to the same domain on a new server?

Skip the URL replace, because the address does not change, but update the database name, user, password and host in wp-config.php. Test the new server through a hosts-file entry before switching DNS, so visitors keep using the old server until the copy is confirmed.

How do I clone a site from one localhost folder to another?

It is the same process with the folder in the URL. Copy the project folder, export and import the database, update wp-config.php, and replace http://localhost/client-a with http://localhost/client-b using WP-CLI or a migration plugin, including the folder name.

Can WebJi® clone or migrate my WordPress site for me?

Yes. A standard single-site migration is free with a WebJi® hosting plan, subject to terms and approval; larger or multi-site moves are quoted before work starts. Request it through the website migration service or email support@webji.services.

Is it legal to clone a WordPress site?

Cloning a site you own, or one a client has asked you to copy, is routine administration. Copying another business’s text, images or design without permission is copyright infringement, even if the WordPress software itself is free to reuse.

Last editorial update: 15 November 2026.

WebJi® since 2005

Ready to get started with WebJi®?

Join 12,000+ businesses across India and overseas. INR pricing, 18% GST shown before payment and 24/7 email support in Hindi and English — average first reply under 60 minutes.