If you need to know how to clone a WordPress site, the goal is simple: a working copy you can break safely. You might want a staging site for testing updates, a copy for a redesign, or a move to new hosting. This guide shows five easy methods, the manual file and database steps, and the mistakes that cause most failed clones.

Quick answer: To clone a WordPress site, copy the files and the database, point wp-config.php at the new database, change the old URL to the new one with a serialization-safe search-replace, then block search engines on the copy. Use a plugin for ease, WP-CLI for speed, or your host’s staging tool.
In this guide
How to clone a WordPress site: what a clone contains
A WordPress site has two halves. The files include WordPress core, your theme, plugins and the uploads folder with your media. The database holds posts, pages, settings, users, menus and plugin data. A true clone copies both, then fixes the addresses stored inside the database so the copy works on its own URL.
Clones are useful for:
- Staging. Test plugin and theme updates before they touch the live site.
- Redesigns. Build changes privately. Our WordPress website redesign guide shows why staging comes first.
- Moving hosts or domains. A clone is the first stage of a move.
Cloning is not the same as a backup, although both copy the same data. A backup is for recovery. A clone is meant to run.
Before you learn how to clone a WordPress site: preparation list
Spend ten minutes here and you avoid most problems.
- [ ] Take a full backup of the live site (files and database) and store it away from the server
- [ ] Note the live URL and the planned clone URL (for example
staging.example.com) - [ ] Check disk space on the destination, including the uploads folder
- [ ] Confirm the destination meets WordPress’s requirements: PHP 8.3 or greater, MariaDB 10.11 or greater or MySQL 8.4 or greater, and HTTPS support
- [ ] Create an empty database and a database user on the destination
- [ ] Decide how you will keep the clone out of search results (covered below)
- [ ] List anything connected to the live site: email, payments, CRM, webhooks, scheduled jobs
5 easy methods to clone a WordPress site
Here is how the options compare before the detail.
| Method | Best for | Skill needed | Main risk |
|---|---|---|---|
| 1. Host staging tool | Quick staging copy on the same host | Low | Tied to one host’s features |
| 2. Migration or clone plugin | Moving to a new host or domain | Low to medium | Large sites can time out |
| 3. Manual files and database | Full control, any host | Medium | Easy to mistype a step |
| 4. WP-CLI | Developers and big sites | High | Wrong command affects the wrong site |
| 5. Local app (for a local copy) | Development on your computer | Low to medium | Copy is not publicly reachable |
Method 1: Use your host’s staging or clone tool
Many hosts offer one-click staging. You press a button, it creates a copy on a test address, and it often offers a push-back option. This is the fastest answer to how to clone a WordPress site for testing. Check three things: whether the copy is blocked from search engines by default, whether it copies the database as well as files, and whether pushing changes back could overwrite new orders or comments on the live site.
Method 2: Use a clone or migration plugin
Plugins such as Duplicator, All-in-One WP Migration or similar packages follow the same pattern. You install the plugin on the live site, create a package (an archive of files and database), then upload it to the destination and run an installer that creates the database content and updates the URLs.
Tips for this method:
- Install a fresh, empty WordPress (or an empty folder, depending on the plugin) on the destination.
- Exclude cache folders and old backups from the package to keep it small.
- Run the installer, enter the new database details, and let it replace the old URL.
- After it finishes, log in, then save permalinks at Settings > Permalinks to refresh rewrite rules.
- Delete the installer files and the package archive when done, because they can expose database details.
Large sites can exceed upload or time limits. If the plugin fails, use the manual method.
Method 3: Clone manually with files and database
This is the most reliable method for how to clone a WordPress site, and it works on any host. It follows the same steps WordPress documents in its guide to moving WordPress, which begins by backing up your directory, images, plugins and other files as well as the database.
Step 1: Copy the files. Download your whole WordPress folder by SFTP or create a zip in your hosting file manager. Upload it to the destination folder.
Step 2: Export the database. Use phpMyAdmin or your host’s database tool to export the live database as a .sql file.
Step 3: Import into a new database. Create an empty database on the destination, then import the .sql file.
Step 4: Edit wp-config.php. On the destination, change the database name, user, password and host to the new values. If the new site uses HTTPS, check that the URL constants include https://.
Step 5: Change the URLs. The database still contains the old site address in many places. Use the search-replace method in the next section. Do not run a plain find-and-replace on the .sql file.
Step 6: Test. Open the clone, log in, check the front end, run a few forms, and save permalinks.
Method 4: Clone with WP-CLI
If you have shell access, WP-CLI is quick and precise. A typical flow:
wp db export live-backup.sql
# copy files and the .sql file to the destination
wp db import live-backup.sql
wp search-replace 'https://example.com' 'https://staging.example.com' --skip-columns=guid --dry-run
wp search-replace 'https://example.com' 'https://staging.example.com' --skip-columns=guid
wp cache flush
The WP-CLI search-replace command handles PHP serialized data, and its --dry-run option runs the whole operation and shows a report without saving changes. Always run the dry run first, and confirm the --url or path points at the clone, not the live site.
Method 5: Clone to a local computer
Local development apps can create a private copy from a package or from files and a database. It suits development, but others cannot reach it. The same URL and database rules apply.
Search-replace pitfalls in how to clone a WordPress site
The step that breaks most clones is changing the URL inside the database. WordPress stores some settings as serialized data, which includes the length of each string. If you replace example.com with a longer name using a plain text replace, the stored lengths no longer match and the setting can fail or reset.
WordPress’s moving guide warns that a direct find-and-replace “can cause issues with data serialization,” and suggests using tools that handle it, such as Better Search Replace or WP-CLI. (The guide also names Velvet Blues Update URLs, but WordPress.org lists that plugin as closed for a security issue, so avoid it.)
Follow these rules:
- Use a serialization-safe tool, not a text editor.
- Dry run first. Look at how many replacements it plans.
- Replace the full URL with scheme (
https://oldtohttps://new), then check for protocol-relative orwwwvariants separately. - Skip the GUID column. WordPress’s guide says: “Never, ever, change the contents of the GUID column, under any circumstances.” That column is a permanent identifier for posts, not a working link.
- Check page-builder data. Elementor, Divi and others store URLs in their own fields. Regenerate their CSS after the replace, using their own tools.
- Back up the clone’s database before the replace, so you can run it again.
If you only need the clone to answer on a different address, you can also override the address in wp-config.php. WordPress’s wp-config documentation says defining WP_HOME and WP_SITEURL overrides the stored values without changing them, and the URL reverts if the lines are removed. That is a quick test aid, not a permanent fix.
Keep the clone out of Google
The last part of how to clone a WordPress site is hiding the copy. A public copy of your site is duplicate content, and it can outrank or confuse the real one. Block it from the start.
Use the WordPress setting. In Settings > Reading, tick “Discourage search engines from indexing this site.” WordPress documentation says this adds a robots meta tag with noindex,nofollow and that neither option blocks access: it is up to search engines to honor the request.
Add a stronger layer. Put the clone behind HTTP password protection, which your host can set up in minutes. A password stops both visitors and crawlers.
Do not rely on robots.txt alone. Google’s noindex documentation says a page must not be blocked by robots.txt for the noindex rule to work, because the crawler will never see it, and the page can still appear in results if other pages link to it.
Mark the environment. Setting WP_ENVIRONMENT_TYPE to staging in wp-config.php labels the copy for WordPress and some plugins. The documented values are local, development, staging and production.
Never copy the “allow indexing” setting back. When you push or migrate a clone to production, re-check Settings > Reading. A launch with search engines still discouraged is a classic way to lose traffic. If you move the site for real, our WordPress migration services include a pre-launch check for exactly this.
Cautions: email, payments and live data
These cautions are general practice from experience, not taken from an official source.
A clone is a full copy of a live system, so it can act like one. These are general good-practice cautions rather than platform rules.
- Email. A clone can send real emails to real customers, such as order notices, password resets and newsletters. Disable outgoing mail on staging or route it to a mail catcher.
- Payments. Switch payment gateways to test mode on the clone, and confirm no live API keys remain. For WooCommerce, never test orders against a live gateway. Our WooCommerce development service handles store builds with test setups.
- Subscriptions and renewals. A copy with live subscriptions may try to charge customers. Turn off renewals on the clone.
- Scheduled tasks. Cron jobs, scheduled posts and backups can run twice. Pause what you do not need.
- Analytics and ad pixels. Remove tracking IDs, or your clone will pollute live reports.
- Customer data. A clone holds personal data. Protect it, and delete it when done.
- Webhooks and integrations. CRM, shipping and ERP connections may fire from the clone. Disconnect them.
Our WordPress security checklist covers protecting copies that hold real user data.
Troubleshooting a clone that does not work
| Symptom | Likely cause | Fix |
|---|---|---|
| “Error establishing a database connection” | Wrong credentials in wp-config.php | Re-check database name, user, password and host |
| Site redirects to the old domain | URLs still point to live | Run search-replace; check home and siteurl |
| Pages 404, home works | Rewrite rules not refreshed | Save permalinks; check .htaccess or Nginx config |
| Broken layout or missing images | Old URLs in builder data or mixed content | Replace URLs, regenerate builder CSS, force HTTPS |
| Settings or widgets reset | Serialized data damaged by plain replace | Restore database, redo with a safe tool |
After the clone: what to do with it
Once you know how to clone a WordPress site, the next question is what to do with the copy. Use the clone for its purpose, then close it out. If it is staging, keep it for future testing and refresh it from live before each new project, so you do not test against old data. If it was a one-off, delete the files and database once you no longer need them, because forgotten copies get hacked and leak data. If the clone becomes the new live site, run the launch checklist: remove search blocking, switch payments to live, test email, update DNS and set up redirects if URLs changed.
Regular care keeps all of this safe. Our WordPress maintenance and support plans include backups and update testing.
Want us to clone or move your site for you?
If you would rather not touch databases yourself, we can help. We can set up a staging copy, test your updates on it, or migrate your site to WordPress with Experts Grow when you move hosts or platforms, with backups taken first and redirects planned. You can get a free migration quote by telling us what you are trying to do, and we will say plainly whether you need a service or a simple plugin.
FAQ
How to clone a WordPress site for free?
Yes. Many clone and migration plugins have free versions, and the manual and WP-CLI methods cost nothing. Free plugin versions sometimes limit package size, so large sites may need the manual method.
How to clone a WordPress site without a plugin?
Copy the files, export and import the database, edit wp-config.php with the new database details, and run a serialization-safe search-replace to change the URLs. The manual method above covers each step.
Will cloning my site hurt my SEO?
Knowing how to clone a WordPress site safely means it will not hurt SEO, provided the clone is hidden from search engines. A public clone creates duplicate content. Use the Discourage search engines setting plus password protection, and never copy that setting to the live site by mistake.
Why does my cloned site still redirect to the old domain?
The database still holds the old address. Run a search-replace for the full URL and check the siteurl and home values. Also clear caching plugins and browser cache.
Can I clone a WooCommerce store?
Yes, but be careful. Put payment gateways in test mode, turn off emails and subscription renewals, and remember that orders placed on the live site after your copy will not appear on the clone.
What is the difference between a clone and a backup?
A backup is a stored copy for recovery. A clone is a running copy with its own address. They hold the same data, but a clone also needs URL changes, its own database and search-engine protection.