Merging two WordPress sites sounds like a very difficult task. But that is not true at all. Depending on the size of your website, you can perform the whole process within a few hours. And the best part is WordPress comes fully equipped with everything you need.
Without further ado, let’s find out how to merge two WordPress websites together.
Before We Start
Before we get going, let’s go through a few basic steps.
You see, we have two WordPress sites involved – an old site that you will transfer, and a new site that will receive the content of the old site.
To keep things simple, let’s assume your old site is http://www.old-site.com, and the new site is http://www.new-site.com.
First of all, create complete backups of both sites. At the very least, have a full backup of the old site. This will be very useful in case something goes wrong during the merging process. If you have the complete backup, you can get back all the data of your old site.
Next, make sure that both of your sites have the same permalink structure. This is crucial to ensure that you are not having any impact on your search engine rankings.
Once you have taken care of these issues, you are ready to move forward with the merging.
Export Content from Old Site
The first step in the merging process is to export content from the old site. To do that, log into your website dashboard, and go to the Tools > Export page.
As you can see, there are several options available. Since you are migrating the whole website, choose the “All content” options, and click “Download Export File.” At this point, an XML file containing all the posts, pages, custom posts, comments, and menus will be downloaded to your computer.
Import Content in New Site
At this point, you have exported the old content to an XML file. You have the XML file downloaded on your computer. Now you need to import the file into the new website.
To do that, log into the dashboard of your new website. Go to Tools > Import. You will see a page like the following –
There are a few options available to import from various sources. You need to install a plugin to import the content. You will find “WordPress” at the bottom of the page. Click “Install Now,” to install the plugin.
Once the plugin is installed, click the “Run Importer” link.
This will take you to a page where you have to upload the XML file you downloaded a while back. Click the “Choose File” button to select the file on your computer. Then, click the “Upload file and import” button.
At this stage, you will be asked to set up the author for the content you just imported. There are three options available –
- You can keep the original author. In that case, leave both fields empty.
- You can create a new user and assign the posts to that user. To do that, provide the username in the first field.
- Lastly, you can set any of the existing users as the author. To do that, select the user from the drop-down menu.
Check the “Download and import file attachments” box. This will add links to the original media files on your old site.
Finally, click “Submit.” This will add the content to your new site. If everything is OK, you will find a success message like the following –
Set Up Redirection
Now that you have exported all the content of the old site, what should you do with it? It wouldn’t be a wise choice to take it offline right away. This will undo all the SEO benefits of that website. Instead, you should set up a side-wide redirect to the new site. Once you do that, any visitor trying to visit the old site will be redirected to the new site.
To do that, you have to edit the .htaccess file of your old site. You will find the file in the root folder of the old site. Use an FTP client like FileZilla or the built-in file manager of your hosting provider to access and edit the file.
Copy the following code and paste it at the top of your .htaccess file –
RewriteRule ^(.*)$ http://www.new-site.com/$1 [R=301,L]
Don’t forget to replace http://www.new-site.com with the URL of your new website. Save the file back to the folder.
From now on, anyone trying to visit the old site will automatically be redirected to the new site.
Remove the Duplicates
If you have completed the steps described above, you have successfully exported your old content and the SEO benefits to the new site.
Now, it’s time to check out if there are any duplicate menu items and pages. To check out the menu, go to Appearance > Menus. Check out the menu items and remove the unnecessary ones. You can do that by expanding the menu item and clicking “Remove.”
And that’s how you merge two WordPress sites together. It wasn’t that complicated, right? Let me know if you have any question about the merging process. I will be glad to help you out.