Publié le Mis à jour le 21 min de lecture

📌 Key takeaways

What does duplicating a WordPress site mean?
Creating a complete copy of an existing site (files + database) to send it to another destination: a new web host, local environment, staging site, etc.

Why clone a site?

  • Carry out tests safely (updates, new plugins, code changes)
  • Change your domain name
  • Migrate to a new web host or a local environment
  • Create a demo site for a client

Two main methods:

  • With a plugin: Duplicator (free and simple), All in One WP Migration, WPvivid
  • Manually: via an FTP client (Filezilla) and phpMyAdmin

The 5 key steps (with Duplicator):

  1. Install and activate the plugin on the site to be cloned
  2. Create a package (archive + installer)
  3. Transfer the files to the new server via FTP
  4. Create a new database
  5. Launch the installer and enter the database credentials

Essential tip: always remember to back up your site before proceeding with a site duplication.

Imagine an active WordPress site at location A, for example on an online hosting server. 

Now, imagine a clone of this first website, identical in every way. This exact copy is located at location B, for example on a local server. 

If you need to duplicate a WordPress site, this scenario should catch your attention. And perhaps annoy you, if you need to clone your site as quickly as possible.

Precisely, here is a solution just for you. By the end of this article, you will be able to copy your WordPress site in 5 step-by-step stages, whether using a plugin or doing it manually. 

What does duplicating a WordPress site mean?

Duplicating a WordPress site is a technical operation that involves creating a copy of an existing site in order to send it to another destination: a new hosting server, a subdirectory or subfolder, a local or staging environment, etc. 

This procedure is also referred to as cloning a WordPress site. It involves the following: 

  • the duplicated website contains all or part of the files and folders of the “original” site. In general, a duplicated site makes it possible to create an independent cloned site in order to carry out tests and other experiments.
    The webmaster then copies all the files and the database (DB) of the site to be cloned, but they can also choose to migrate only the elements they want. For example, it is possible to exclude media, pages, or database tables;
  • the changes you make to the duplicated site do not affect the one already in production. The two sites operate independently.

Note that the process of duplicating a WordPress site should not be confused with a backup (also called a WordPress backup).

When you back up a website, you are “only” creating a copy of your files and/or your database so that you can restore it in the event of a technical problem. You are therefore not replicating a site identically. 

Nevertheless, backing up is one of the steps—in any case, it is highly recommended—when cloning a WP site.

Duplicating a WordPress site involves backing it up.

Why clone a WordPress site?

Cloning a WordPress site is an operation that offers many advantages.

Above all, it will become necessary in various situations, ranging from setting up tests to needing to migrate to a new web host, for example.

Detailed explanations just below. 

Carry out tests safely

First of all, having a copy of WordPress is a good practice whenever you want to carry out tests and other WordPress maintenance operations. 

We are thinking, for example, of the following situations: 

  • updates to your plugins, themes, and WordPress Core (Core, the CMS’s basic files); 
  • adding one or more new plugins;
  • modifying the CSS code to improve the design of your pages; 
  • changing the PHP version to speed up page loading and improve the user experience (UX);
  • adding snippets of code to a child theme, a page, etc.

Thanks to a duplicated site, you cover your back. If a bug, incompatibility, or error occurs when you activate a new plugin, for example, your live site will not be affected and will not become unavailable.

You will have plenty of opportunity to see where the problem lies on the clone, so you do not experience the same situation again later on the instance you duplicated!

Good to know: Whenever you want to carry out a test or make a change on your live site, first perform your actions on the cloned one! If everything goes well, deploy the same operation to production with complete peace of mind. If there is an issue, make the necessary adjustments before switching it online. 

Changing domain name

A second classic scenario that justifies duplicating a WordPress site involves a change of domain name. 

Good to know: A domain name is the address of your WordPress website on the internet. It consists of a name (e.g.: maintenance-wp) and an extension (e.g.: .fr, .com, .io etc.).
For example, Maintenance WP’s domain name corresponds to the URL maintenance-wp.fr.

Several reasons may lead you to need/want to change your domain name. One of the most common concerns a change of identity in your branding. 

In order to keep your current site as it is, with all its content (posts, pages, etc.) and settings, you will need to clone it to a hosting space to which your new domain name points.

This can be done with your current hosting provider or with another WordPress hosting provider. 

Good to know: Once you have duplicated your site on this new domain name, you will need to remember to redirect the old domain name to the new one. This way, as soon as an internet user clicks on your old site, they will be sure to land on the one associated with the new domain name. This redirection can be done in just a few clicks using a free tool such as Google Search Console, or through the administration interface provided by your hosting provider (e.g., cPanel), as we explain in this article.

cPanel allows you to redirect a domain name.
cPanel allows you to redirect a domain name.

Migrate the site to a new location

The procedure that involves duplicating WordPress will also be necessary when you need to migrate your site to a new location. 

There are several possible scenarios: 

  • migration to a new hosting provider. This may be justified for pricing reasons or because you want to benefit from a more powerful plan with more storage space and/or improved performance;
  • the desire to transfer WordPress to a local environment (on your computer). Duplicating a live WordPress site to a local server (and vice versa) allows you to carry out your tests with peace of mind. To do this, you can use free tools such as Local or DevKinsta;
  • creating a WordPress staging site (pre-production), again for development or testing purposes. Unlike a locally installed WordPress site, the staging site is configured online but is not accessible to the public.
    To activate a staging site, you can use a dedicated WordPress plugin such as WP Staging;  
  • moving your online site to a subdomain (e.g.: maintenance.votresite.fr) or a subdirectory (e.g.: votresite.fr/maintenance).

Create a demo site

Finally, if you are a service provider who creates WordPress sites, duplicating WordPress offers an advantage if you want to set up a demo site for your clients. 

The usefulness of such a procedure lies mainly in the time savings it will give you. Here, you take advantage of an existing site that you clone in order to customize it according to the needs of each of your clients. 

After these theoretical explanations, let’s move on to the technical setup.

We will now show you the different existing ways to clone a WordPress site. 

How to duplicate a WordPress site with a plugin (5 steps)?

To duplicate WordPress, you have two main options:

  1. Using a plugin.
  2. The manual method.

First, we will focus on using a plugin to clone your WordPress site.

This is the fastest and least technical procedure, since it does not involve handling code or sensitive files.

The risk of errors is also lower than when doing it manually, which makes using a plugin a popular method among beginners.

In the official directory, there are many WordPress migration plugins to help you duplicate your website. Among the most well-known are: 

For the purposes of this test, we chose Duplicator for several reasons: 

  • it is simple to use and easy to get to grips with; 
  • it is reliable, comprehensive, and its free version will be sufficient in most cases;
  • it allows you to duplicate WordPress to the destination of your choice (online, locally, on a staging site, etc.), which is not the case with all of its competitors. Migrate Guru, for example, does not allow you to duplicate a WordPress site from local to online;
  • it is frequently updated; 
  • it is very highly rated (4.9 stars out of 5) and has excellent user reviews; 
  • it is a little less limited than All in One WP Migration regarding the size of the sites to be duplicated (All in One WP Migration limits you to a total size of 512 MB in its free version, for example). However, the free version of Duplicator still will not allow you to duplicate a very large site.
Duplicator is a plugin that allows you to duplicate a WordPress site.

Without further ado, here is the step-by-step process to duplicate a WordPress site with Duplicator.

Good to know: Even though Duplicator will create a backup during the cloning process, we recommend backing up your site beforehand to be on the safe side. To do this, you can use a dedicated plugin like UpdraftPlus. Better to have too many backups than not enough.
By the way, note that you must of course already have an environment available on which you will clone your site. This could therefore be a new hosting space, a local environment, a subdirectory on your current hosting server, etc. 

Step 1: Install and activate Duplicator on the site to be cloned

To begin, install the Duplicator plugin on the WordPress site to be duplicated.

To do this, go to Plugins > Add New, then type “Duplicator” in the search bar:

Installing Duplicator on the WordPress dashboard.

Click “Install Now” and remember to activate the plugin right away.

If all goes well, you will have a new menu in the left sidebar of your WordPress admin interface (back office):

Duplicator menu for duplicating a WordPress site.

Step 2: Create a copy of the WordPress site to be duplicated

The plugin is ready to use, so let’s continue. Now go to the Duplicator > Packages menu. 

Click the “Create a package” button, at the top right:

Creating a package with Duplicator.

Good to know: In Duplicator, a package is a zip archive containing your entire site (files + database) as well as an installer file to duplicate your WordPress site to the location of your choice.

Here, Duplicator will back up your site. The plugin automatically offers you various options related to the content to be cloned.

In most cases, you don’t need to change anything if you want to duplicate your entire WordPress site. Leave it as is; the default settings are sufficient. 

However, you can still make a few adjustments if needed.

For example, it is possible to exclude certain tables from your database from the backup, inside the section called “Archive”. 

When everything looks good to you, click the “Next” button:

Duplicator allows you to create a package to duplicate a WordPress site.

Duplicator will scan your content. Generally, the response time is a handful of seconds (it may take more or less time depending on the size of your site), and you will receive a report indicating any possible errors.

At this stage, you can still make a few adjustments, for example by deleting files deemed too large.

To continue, click the “Yes. Let’s continue with the build process!” checkbox, then the “Create” button:

Duplicator build process.

Next, Duplicator will take care of building your package. As we mentioned above, it consists of two elements: 

  1. An installer in the form of a installer.php file.
  2. An archive containing the files and the database.

Click “Download Both Files” to download these two files to your computer:

Downloading the files archived by Duplicator.

Step 3: Upload the WordPress site to be duplicated to your server

Now it’s time for step 3 of our procedure for duplicating a WordPress site with Duplicator.

You must now send the site to be cloned to its new destination. For this example, we are going to send it to an online hosting server. How do you do that? Here is the answer!

Good to know: Would you rather duplicate a WordPress site locally? The method is the same, give or take a few details. Instead of placing your installer.php file and your site’s zip archive on your hosting server, add them to the root directory of your local site. This folder is called, for example, “public” in the Local tool and contains the basic WordPress files and directories (the ones you download to install the CMS). 

To do this, you need an FTP client (File Transfer Protocol). There are several on the market, such as: 

For the purposes of this test, we will use Filezilla. Log in to Filezilla using the credentials provided by your hosting provider. In particular, you need to enter: 

  • a host; 
  • a username; 
  • a password; 
  • a port.
Connection to Filezilla FTP.

Next, locate the root. This is the base folder of your website’s directory structure. The one that contains all your directories and files.

It has a different name depending on the hosting provider you use, as in the examples below:

  • At OVH, it is called www.
  • At Kinsta, the hosting provider we recommend, it is called public.
  • At o2switch, it is called public_html.

Inside this root directory, drag your installer.php file and your site’s zip archive:

The root directory of a WordPress site.

Step 4: Create a database to duplicate WordPress

In order to work, WordPress needs to be connected to a database. This contains all the content of your site (e.g.: posts, pages, plugin settings, etc.).

If you haven’t created it yet, you must therefore do so and link it to your cloned site. How? The answer is just below.

To do this, go to your hosting provider’s interface (its back office). In this article, we will use cPanel, one of the best-known interfaces. 

Once logged in, go to the section titled “Databases” and click on “MySQL Databases,” in the middle of the proposed list:

Creating a MySQL database in cPanel.

Give your new database a name. Use lowercase letters and avoid spaces and accents.

Finish by clicking the “Create Database” button: 

Creating a new database is necessary to create a WordPress site.


Continue by creating a user for this new database. Enter a username and a password.

Take advantage of cPanel’s password generator to create a strong password. Then click the “Create User” button:

Adding a new user to the database.

Good to know: Keep the name of your database, your username, and your password in a text file on your computer, just in case. 

Finish by adding a user to your database and click the “Add” button:

Adding a user to the WordPress database.

You will then be asked to grant privileges to the user. Click the “All privileges” box, then the “Make changes” button at the bottom of the list provided:

Database privileges.

The WordPress database to be duplicated is ready. All your content (posts, pages, comments, etc.) will be stored inside it.

Step 5: Finish cloning the WordPress site with Duplicator

To complete the cloning process, launch the Duplicator installer in a new tab in your web browser. 

To do this, enter the URL of the cloned site and add /installer.php to the end of it. It would look something like this: 

https://maintenance-wp-clone.fr/installer.php

Duplicator will then show you any potential errors, and you will need to enter your database credentials in the “Setup” tab (username, ID, password, etc.):

Deploying the Duplicator installer.

Then click the “Validate” button at the bottom of the page. Duplicator will then show you certain blocking issues (in red) in the “Validation” tab of the page.

If everything looks good to you, check the “I have read and accept all terms & notices” box and click the “Next” button:

Accepting Duplicator’s terms to clone a WordPress site.

And there you have it, everything should have worked correctly for you. To finish, check the “Auto delete installer files after login to secure site (recommended!)” box.

This allows you to automatically delete the installer.php file and the folder from your site to be cloned. 

To protect your site, it’s safer this way, so no one can access this information. 

Click the “Admin login” button to check that your WordPress site has been successfully duplicated and to finalize its installation:

Logging in to the WordPress admin area.

To finish, remember to delete the installation files by clicking the corresponding button in the box called “Stored data”:

The Duplicator interface in your WordPress back office after duplicating your site.
The Duplicator interface in your WordPress back office after duplication.

Check that all your content is present (pages, posts, media, etc.). Normally, everything should be there.

We’re done with this first method, which consists of duplicating a WordPress site with the Duplicator plugin. 

Now see how to clone a site manually, without the help of a plugin this time. 

Good to know: If you want to clone a site on a WordPress multisite network, we recommend using the WordPress plugin NS Cloner, which is specially dedicated to this. 

How to duplicate a WordPress site manually (5 steps)?

Step 1: Copy the site to be duplicated

To get started, you need to download the files and folders of the WordPress site to be duplicated (pages, posts, plugins, themes, etc.). 

They are contained in the root directory. To access it, log in to your favorite FTP client as you did in step 3 with the Duplicator plugin. 

Select your root directory (e.g.: public_html) by clicking on it, then right-click and choose “Download”:

Manually, it is possible to duplicate a WordPress site by downloading—among other things—its files via FTP.

Depending on the size of your site, this process will take more or less time and may take several minutes. A folder in .zip format will be created. 

Step 2: Export the database of the site to be cloned

Secondly, you need to export the MySQL database of the site to be cloned. To do this, go to the administration interface provided by your hosting provider.

Here, we’ll go back to cPanel, which you discovered earlier. In the “Databases” section, this time click on “phpMyAdmin”:

phpMyAdmin allows you to manage a database when you need to clone a WordPress site.

Good to know: phpMyAdmin is a web application used to manage your database. 

On the left side of your window, select your database. You will then see the tables it contains appear.

Click the “Export” tab to download it:

Exporting a database in phpMyAdmin.

The default settings are already functional. Just make sure that the proposed format is set to “SQL”, then click the “Export” button:

Exporting the tables of the WordPress site to be duplicated in phpMyAdmin.

A file in .sql format (the one associated with the MySQL system used by your database) will then be downloaded to your computer.

Place it on your desktop, for example. We’ll need it later. 

Step 3: Transfer the files of the site to be duplicated to a new server

Now it’s time for step 3 of the manual method for duplicating your WordPress site: adding the files and directories of the site to be cloned to the new hosting server. 

To do this, unzip the zip archive downloaded in step 1. Log in to the hosting server of the site that will be cloned using your FTP client.

Then simply add the files of the site to be duplicated to the root directory of the future cloned site.

Step 4: Create a new database and migrate the database of the site to be duplicated

Next, you need to create a database that will be linked to the cloned site.

For the procedure to follow, I’ll refer you to the tutorial presented in step 4 with the Duplicator plugin. 

As a reminder, you need to: 

  1. Log in to cPanel. 
  2. Create a new database.
  3. Create a new user for this database.
  4. Add the user to the database.
  5. Grant all privileges to this user. 

Once you have finished this, import the database of the site to be duplicated onto the hosting server of the cloned site. 

Everything takes place once again in phpMyAdmin. After selecting your new database, click the Import tab.

In the section called ‘File to import’, choose the previously downloaded .sql file (see step 2):

Importing a database into phpMyAdmin.

Leave the other options as they are, then click the “Import” button at the bottom of the page. 

Step 5: Edit the database credentials in wp-config.php

To finish, you need to enter the information for your new database in the wp-config.php file.

In FileZilla, open this file in your root directory, then enter the credentials related to the database of the cloned site that you created in the previous step. 

For your information, this concerns the following details: 

  • DB_NAME corresponds to the name of your database;
  • DB_USER corresponds to your username;
  • DB_PASSWORD corresponds to your database password; 
  • DB_HOST corresponds to the database server at your web host. If you are cloning the site with the same host, you will not need to change anything.
    However, if you are moving it to a new host, the name will probably be different. Contact the host in question to ask which value you should enter here.
The WordPress wp-config file.
Replace the “XXXXXXXX” with the values of your choice.

Finally, if you are duplicating your WordPress site to a new domain name or subdomain, add these two lines of code to your wp-config.php file, below the following comment line: “/* That’s all, stop editing! Happy publishing. */”:

define( 'WP_HOME', 'https://votrenouveaudomaine.tld' );
define( 'WP_SITEURL', 'https://votrenouveaudomaine.tld' );

Save your file and check that everything is working properly after refreshing your site in a web browser. 

Good to know: Some hosting providers also offer their own in-house solution for automatically cloning a site. This is the case, for example, with Kinsta, the host we recommend, via its MyKinsta dashboard. The French host o2switch, for its part, lets you clone a site for testing purposes (staging) thanks to its WP Tiger toolbox.

How to duplicate a page or post in WordPress?

As you’ve understood, the goal of this article is to teach you how to duplicate a WordPress site. 

Except that sometimes, you’ll only need to clone a post or a page without needing to duplicate your entire site.

If you ever run into this scenario, it’s very simple.

To clone a post, you can copy the content of the post to be duplicated by selecting it in full, then paste everything into a new post. It’s as simple as that.

To do this, you have two options for copying the content: 

  • the manual method, which consists of selecting all the blocks on the page or post concerned using Ctrl + C (PC) or Cmd + C (Mac); 
  • use the “Copy all blocks” option offered by the WordPress content editor (also called Gutenberg).
WordPress has a built-in option for easily cloning a page.

Whatever option you choose, also remember to paste the copied content into your new publication (post or page).

Good to know: If you prefer to use a plugin, we recommend Yoast Duplicate Post. Yoast Duplicate Post notably lets you move any cloned content to Draft, so you can edit it at your own pace in the Gutenberg editor. Once you have made your changes, you can schedule a new publication date, if needed. Yoast Duplicate Post is therefore very handy if you need to update your blog posts with complete peace of mind.

Summary 

Duplicating a WordPress site is an operation you will have to carry out in certain situations, such as when you need to migrate your site from the live environment to your local server. 

Throughout this guide, you have learned the following: 

  • the reasons that may lead you to clone a WordPress site; 
  • how to duplicate your site with and without a plugin; 
  • how to clone a page or a blog post very easily, in just a few clicks, in the WordPress editor.

Duplicating a WordPress site requires a minimum level of technical expertise. If you choose the manual method, for example, you will need to handle the core files of your installation, as well as your database. 

To avoid any risk of errors or bugs, would you like assistance in implementing our various tips for duplicating your WordPress site?

Available 7 days a week, Maintenance WP’s WordPress support service will offer you a tailor-made solution that meets your needs quickly, professionally and effectively.

Découvrez plus de contenus

fleche separateur

Voir plus d’articles