📌 To remember
What does it mean to duplicate a WordPress site?
Create a complete copy of an existing site (files + database) to send it to another destination: new host, local environment, pre-production site, etc.
Why clone a website?
- Perform tests safely (updates, new extensions, code changes)
- Change your domain name
- Migrate to a new hosting provider or a local environment
- Create a demo website for a client
Two main methods:
- With an extension: Duplicator (free and simple), All in One WP Migration, WPvivid
- Manuallyvia an FTP client (FileZilla) and phpMyAdmin
The 5 key steps (with Duplicator):
- Install and activate the extension on the site to be cloned.
- Create a package (archive + installer)
- Transfer the files to the new server via FTP
- Create a new database
- Launch the installer and enter the database credentials.
Essential advice: Remember to always back up your site before duplicating it.
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 siteThis situation should give you pause. And perhaps annoy you, if you need to clone your site as quickly as possible.
Here's a solution just for you. By the end of this article, you'll be able to Copy your WordPress site in 5 step-by-step, whether using a plugin or manually.
What does it mean to duplicate a WordPress site?
Duplicating a WordPress site is a technical operation that consists of create a copy of an existing website 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" website.In general, a duplicated site allows you to create an independent clone 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 of their choice. For example, it is possible to exclude media, pages or database tables; - The changes you make to the duplicated site will 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 backup (also called WordPress backup).
When you back up a website, you are "only" creating a copy of your files and/or database so that you can restore it in case of a technical problem. You are not replicating the site exactly.
However, backup is one of the steps – in any case it is highly recommended – of cloning a WP site.
Why clone a WordPress site?
Cloning a WordPress site is an operation that offers many advantages.
It will be particularly important to you in various situations, ranging from setting up tests to the need to migrate to a new hosting provider, for example.
Detailed explanations just below.
Conduct tests safely
Initially, having a copy of WordPress is good practice whenever you want to perform tests and other operations. WordPress maintenance.
We are thinking, for example, of the following situations:
- updates to your pluginsthemes and the Heart (Core, the basic files of the CMS) of WordPress;
- adding one or more new extensions ;
- CSS code modification in order to improve the design of your pages;
- changing the PHP version to accelerate page load speed and improve user experience (UX);
- adding code snippets to a child theme, a page etc.
By using a duplicate site, you have a backup plan. 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 time to see where the problem lies on the clone, so as not to experience the same situation later on the instance you duplicated!
Tips Whenever you want to test or modify your live site, first perform your actions on the cloned version! If everything goes smoothly, confidently deploy the same operation to production. If any issues arise, make the necessary adjustments before going live.
Change your domain name
A second classic scenario that justifies duplicating a WordPress site applies to domain name change.
Tips 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, the domain name for WP Maintenance 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 in your brand identity.
In order to keep your current site as is, with all its content (articles, pages etc.) and settings, you will need to clone it onto a hosting space to which your new domain name points.
This can be done with your current hosting provider or with another one. WordPress hosting.
Tips Once you've duplicated your site on this new domain name, you'll need to redirect the old domain name to the new one. This way, whenever a user clicks on your old site, they'll be guaranteed 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 like... Google Search Console, or via the administration interface provided by your hosting provider (e.g., cPanel), as we explain in this article.
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.
Several scenarios are possible:
- the migration to a new hosting providerThis may be justified for pricing reasons or because you want to benefit from a more powerful offer 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 perform your tests with complete peace of mind. For this, you can use free tools such as Local News ou DevKinsta ;
- the creation of a WordPress staging website (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 (ex:
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 wish to set up a demonstration website for your clients.
The main advantage of this procedure is the time it saves you. Here, you take advantage of an existing website that you clone in order to customize it to meet the needs of each of your clients.
After these theoretical explanations, it's time for the technical implementation.
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:
- The use of a plugin.
- The manual method.
Initially, we will focus on using an extension to clone your WordPress site.
This is the fastest and least technical procedure, since it does not involve manipulating sensitive code or files.
The risks of errors are also less significant than when proceeding manually, which makes using a plugin a popular method for beginners.
On the official directory, numerous WordPress migration plugins exist to help you duplicate your website. Among the most popular are:
- All in One WP Migration (5 million + active installations);
- Duplicator (1 million + active installations);
- WPvivid (300,000 active installations);
- Migrate Guru (80,000 active installations).
For the purposes of this test, we chose Duplicator for several reasons:
- there is simple to handle and easy to get the hang of ;
- It is reliable, comprehensive, and its free version will suffice in most cases;
- it allows duplicate WordPress to the destination of your choice (online, locally, on a staging site, etc.), which is not the case for all its competitors. Migrate Guru, for example, does not allow duplicating a WordPress site from local to online;
- It is frequently updated;
- there is highly rated (4,9 out of 5 stars) and has excellent user reviews;
- It's slightly less limited than All in One WP Migration regarding the size of sites that can 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 won't allow you to duplicate a very large site.
Without further ado, here is the step-by-step guide to duplicating a WordPress site with Duplicator.
Tips Even though Duplicator will create a backup during the cloning process, we recommend backing up your site beforehand as a precaution. You can use a dedicated extension for this purpose, such as UpdraftPlusIt's better to have too many backups than not enough.
Incidentally, note that you must already have an environment available on which to clone your site. This could 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 you want to duplicate.
To do this, go to Extensions > Add New, then type "Duplicator" in the search bar:
Click on "Install now" and remember to activate the extension afterwards.
If everything goes well, you will have a new menu in the left sidebar of your WordPress administration interface (back office):
Step 2: Create a copy of the WordPress site to duplicate
The extension is ready to use, so let's continue. Now go to the Duplicator > Packages menu.
Click the "Create a package" button, top right:
Tips : At Duplicator, a package corresponds to a zip archive encompassing your entire site (files + database) as well as an installation file to duplicate your WordPress site to the location of your choice.
Here, Duplicator will back up your site. The plugin will automatically offer you various options related to the content you want to clone.
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 some 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 is good to you, click the "Next" button:
Duplicator will scan your content. Generally, the response time is a few seconds (it may be longer or shorter depending on the size of your site) and you will receive a report indicating any errors.
At this stage, you can still make some adjustments, for example by deleting files deemed too large.
To continue, click on the "Yes. Let's continue with the assembly process!" box, then on the "Create" button:
Next, Duplicator will assemble your package. As mentioned above, it consists of two elements:
- An installer in the form ofA file
installer.php. - An archive including the files and the database.
Click on "Download Both Files" to download these two files to your computer:
Step 3: Download the WordPress site to duplicate onto your server
Now let's move on to step #3 of our procedure for duplicating a WordPress site with Duplicator.
Now you must send the site to be cloned to its new destinationFor this example, we're going to upload it to an online hosting server. How do we do that? Here's the answer!
Tips Do you want to duplicate a WordPress site locally? The method is the same, with a few minor differences. Instead of uploading your file installer.php and the zip archive of your site 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 (those you download to install the CMS).
For this, you need an FTP client (File Transfer ProtocolThere are several on the market, such as:
- Filezilla (free, open source, Mac and Windows);
- Cyberduck (free, Mac and Windows);
- Transmit (paid, Mac).
For the purposes of this test, we will use FileZilla. Connect to FileZilla using the credentials provided by your hosting provider. You will need to enter the following information:
- a host;
- an identifier;
- a password;
- a port.
Next, locate the root. This is the the home directory of your website's directory structureThe 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's called
www. - At KinstaThe hosting provider we recommend is called
public. - At o2switch, it's called
public_html.
Inside this root directory, drag your file installer.php and the zip archive of your site:
Step 4: Create a database to duplicate WordPress
In order to function, WordPress needs to be connected to a databaseThis includes all the content of your site (e.g., articles, pages, plugin settings, etc.).
If you haven't created it yet, you need to 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 (their back office). In this article, we will use cPanel, one of the most well-known interfaces.
Once logged in, go to the section titled "Databases" and click on "MySQL Databases" in the middle of the list provided:
Give your new database a name. Use lowercase letters and avoid spaces and accents..
Finish by clicking the "Create a database" button:
Continue by creating a user for this new database. Enter a username and password.
Use cPanel's password generator to create a strong password.Next, click on the "Create a user" button:
Tips Keep your database name, username, and password in a text file on your computer, just in case.
Finally, add a user to your database and click the "Add" button:
You will then be asked to grant privileges to the user. Click on the "All privileges" checkbox, then on the "Make changes" button at the bottom of the list:
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 of your web browser..
To do this, enter the URL of the cloned site and add it to the end /installer.phpIt would look something like this:
https://maintenance-wp-clone.fr/installer.php
Duplicator will then indicate any potential errors, and you will need to enter your database credentials in the "Setup" tab (username, identifier, password, etc.):
Then click the "Validate" button at the bottom of the page. Duplicator will then indicate certain blocking points (in red) in the "Validation" tab of the page.
If everything is okay with you, tick the box "I have read and accept all terms & notices" and click the "Next" button:
And there you have it, everything should have worked correctly for you. To finish, check the box "Auto delete installer files after login to secure site (recommended!)".
This allows to automatically delete the file installer.php and the folder of your site to clone.
To protect your site, it's safer, that way no one can access this information.
Click the "Admin login" button to verify that your WordPress site has been successfully duplicated and to finalize its installation:
Finally, remember to delete the installation files by clicking on the corresponding button in the section called "Stored Data":
Check that all your content (pages, articles, media, etc.) is present. Normally, everything should be there.
We have now finished with this first method which consists of duplicating a WordPress site with the Duplicator plugin.
See now how to clone a website manually, without the help of an extension this time.
Tips If you wish to clone a site located on a WordPress multisite networkWe recommend using the WordPress plugin NS cloner, specifically 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 from the WordPress site you want to duplicate (pages, posts, plugins, themes, etc.).
They are contained in the root directoryTo access it, connect 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":
Depending on the size of your site, This process will be more or less lengthy and may take several minutes.A .zip file will be created.
Step 2: Export the database of the site to be cloned
Next, you need to export the MySQL database of the site you want to clone. To do this, go to the administration interface provided by your hosting provider.
Here, we'll return to cPanel, which you saw earlier. In the "Databases" section, This time click on "phpMyAdmin" :
Tips : phpMyAdmin is a web application used to manage your database.
In the left-hand side of your window, select your database. You will then see the tables that make it up.
Click on the "Export" tab to download it:
The default settings are already functional. Just make sure the format is set to "SQL", then click the "Export" button:
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 desk, for example. We'll need it later.
Step 3: Transfer the files from the site to be duplicated to a new server
Now for step #3 of the manual method to duplicate your WordPress site: adding the files and directories of the site to be cloned onto the new hosting server.
To do this, unzip the downloaded zip archive from step 1. Connect to the hosting server of the site that will be cloned using your FTP client.
Then simply add the files from the site to be duplicated into the root directory of the future cloned site.
Step 4: Create a new database and migrate the one from the site to be duplicated.
In the process, it is necessary to create a database that will be linked to the cloned site.
For the procedure, I refer you to the tutorial presented in step 4 with the Duplicator extension.
As a reminder, you must:
- Log in to cPanel.
- Create a new database.
- Create a new user for this database.
- Add the user to the database.
- Grant all privileges to this user.
When you have finished with that, import the database of the site to be duplicated onto the hosting server of the cloned site.
Everything happens again in phpMyAdmin. After selecting your new database, click on the "Import" tab.
In the section called "File to import", Choose the .sql file downloaded previously. (see step #2):
Leave the other options as they are, then click the "Import" button at the bottom of the page.
Step 5: Modify the database credentials in wp-config.php
In conclusion, it is necessary to enter the information relating to your new database in the file wp-config.php.
On 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 information:
- DB_NAME corresponds to the name of your database;
- DB_USER corresponds to your username;
- DB_PASSWORD corresponds to your database password;
- DB_HOST This corresponds to the database server at your hosting provider. If you clone the site at the same hosting provider, you won't need to change anything.
However, if you move it to a new hosting provider, the name will likely be different. Contact the hosting provider in question to ask them what value you should enter here.
Finally, if you duplicate your WordPress site to a new domain name or subdomain, add these two lines of code to your file. wp-config.php, under the following comment line: "/* That's all, don't touch what follows! Happy publishing. */"
define( 'WP_HOME', 'https://votrenouveaudomaine.tld' );
define( 'WP_SITEURL', 'https://votrenouveaudomaine.tld' );
Save your file and check that everything is working correctly after refreshing your site in a web browser.
Tips Some hosting providers also offer their own in-house solution for automatically cloning a website. This is the case, for example, with Kinsta, the hosting provider we recommend, via its MyKinsta dashboard. The French hosting provider o2switch, on the other hand, allows you to clone a website for testing purposes (pre-production) using its WP Tiger toolkit.
How do I duplicate a page or post on WordPress?
As you've probably guessed, the goal of this article is to teach you how to duplicate a WordPress site.
Except that sometimes, you'll just need to clone an article (post) or a page without needing to duplicate your entire site.
If you ever encounter this situation, it's very simple.
To clone an article, you can copy the content of the post you want to duplicate by selecting it entirely, then paste everything into a new post. It's that simple.
To do this, you have two options for copying the content:
- the manual method, which consists of selecting all the blocks of the page or article (post) concerned via a Ctrl + C (PC) or a Cmd + C (Mac);
- use the "Copy all blocks" option offered by the WordPress content editor (also called Gutenberg).
Whichever option you choose, remember to also paste the copied content into your new publication (post or page).
Tips If you prefer to use a plugin, we recommend Yoast Duplicate Post. Yoast Duplicate Post This feature allows you to save any cloned content as a draft, so you can edit it at your own pace in the Gutenberg editor. Once you've made your changes, you can schedule a new publication date, if needed. Yoast Duplicate Post is therefore very useful if you need to update your blog posts with ease.
Summary
Duplicating a WordPress site is an operation you will have to undertake in certain situations, such as when you need to migrate your site from the online environment to your local server.
Throughout these lines, you have discovered the following things:
- What are the reasons that might lead you to clone a WordPress site?
- How to duplicate your site with and without a plugin;
- How to clone a blog page or post very easily, in just a few clicks, using the WordPress editor.
Duplicating a WordPress site requires a minimum of technical expertiseIf you opt for the manual method, you will, for example, have to manipulate the basic files of your installation, as well as your database.
To avoid any risk of error or bug, would you like to be assisted in implementing our various tips for duplicating your WordPress site?
Available 7 days a week, WordPress support service WP Maintenance will offer you a tailor-made solution that will meet your needs with speed, professionalism and efficiency.