What to consider when migrating WordPress content to another WordPress site
By: Lisa Manfield | December 19, 2016 | Business solutions and Web solutions
Migrating content from one WordPress site into a new site is typically relatively straightforward, but merging two existing sites together - especially sites with different content types, categories, and functionality - can actually be a labour-intensive process that requires planning, testing, and attention to detail.
We recently merged two sites for a client who runs multiple high-traffic WordPress sites. The two sites had some topical overlap, so 2,000 pages were migrated over with the goal of preserving functionality, traffic, and search rankings.
These were our main steps and considerations throughout the process of planning and implementing the migration and merger:
Content mapping
Before migrating content from Site A to Site B, we had to plan where the content being moved would fit into the new site. Content in any content management system, whether WordPress or otherwise, is typically assigned one or more categories, and also has associated tags. If the content categories and tags on the two sites are different, then a straight import won’t be possible without specifying a replacement category and replacement tags for every missing one.
However, replacement categories and tags aren’t always required, particularly if you’re merging one category or tag into another, creating new categories and tags, or creating new structures altogether, such as moving a category or tag into a sub-category or tag tree.
Moreover, we had an extra layer of complexity because some of the content that we were migrating from Site A to Site B relied on custom fields that were either not present on Site B or were being populated in a different way. That meant making some adaptations to the data so that it would make sense in the fields of the recipient site. For instance, a field that was being populated with "yes" or "no" on Site A had an analogous field on Site B that was being populated with "0" or "1" -- this required special care for underlying functions to be appropriately updated.
URL structure and media files
Another important consideration when migrating content is the URL structure, which needs to be consistent. In our case, the URL structure was slightly different on each site, so we had to change the URLs on content that was migrated over.
Blog content on Site A had a URL structure like this:
/blog/postURL
Blog content on Site B had a URL structure like this:
/postURL
In addition to the URL structure, we had to update hardcoded references to internal files (such as images) and hosted content on Site A. Due to the way WordPress handles internal links, updating these references is a common challenge. Some media files (such as post preview images) are associated with specific posts based on their post IDs, and we needed to ensure that these associations were properly migrated because Site B assigns new IDs during the migration process.
We solved these issues using custom PHP scripts and the WordPress XML-RPC API to automate the following steps:
- Export the posts from Site A and create a log of their post IDs and preview images
- Download local copies of the images
- Import the posts from Site A into Site B and create a log of the new post IDs on Site B
- Upload the preview images onto Site B and update each post ID to reference the corresponding image
Custom post types
In addition to standard page templates in WordPress, Site A had several custom post types that required importing. In order to preserve these custom post types and their functionality, we had to migrate the theme’s functions.php file and add it into the new theme so that sidebar widgets and custom ad rotations continued to work as expected. This required making changes to the site design as well, including the homepage, in order to display the new custom post types.
Plugins
Many WordPress sites use plugins to achieve specific functionality. To preserve that functionality, we needed to migrate plugins along with content from Site A to Site B. It’s critical to find out if your plugins will work on the recipient site, and in some cases, it might be necessary to update the plugin or the version of WordPress so that the migrated plugins continue to work.
We also needed to identify how the plugins were being used on Site A so that we could ensure we used them the same way on Site B. For example, Site A had a taxonomy plugin that was used to build a menu, so we needed to ensure the menu looked and behaved the same way on Site B as it did on Site A.
Host-side issues with WP Engine
When doing a migration, you need to ensure you can get access to the files you need through your site host. We were working with WP Engine, a host that has strict rules with regard to working with the file versioning system, and we had to adhere to specific ways of accessing the content.
For instance, WP Engine does not allow users to connect directly to its servers via SSH, so we had to run our migration automation scripts locally and communicate with WordPress XML-RPC API remotely.
Traffic
One of the most important considerations for site owners is to maintain traffic to the content being migrated. And that means implementing traffic redirects. In our case, we mapped redirects for the blog posts (see URL examples above), custom page types, and general pages (such as the “contact us” page) to the new site using the correct HTTP redirect status so as to preserve accrued SEO value and page rank. Sometimes redirects are required from one page to another, while in other cases, redirects involve one group of paths to another.
Due to careful planning and attention to detail, our WordPress to WordPress content merger and migration was a success, preserving functionality and traffic.
Need help migrating your WordPress content? Mugo has experience migrating content from WordPress to WordPress, or from WordPress to another CMS. Contact us anytime.