Migrating content to another website is a dilemma that many WordPress users face at one time in their life. The act of copying specific posts and pages over to a new website involves copying table rows from one database to another. Doing this directly using a database management tool such as PHPMyAdmin requires knowledge of MySQL and a good understanding of how databases operate.
Thankfully, a more practical solution exists. The Official WordPress Importer allows you to easily export content into another website using an XML file. It allows you to move:
- Posts, pages and other custom post types
- Custom fields and post meta
- Categories, tags and terms from custom taxonomies
I used the WordPress importer a few years ago. At the time, I had an official company blog which I was publishing company news and personal posts. Later, I made the decision to migrate the personal articles to a separate blog on a different domain. The importer allowed me to do this easily.
In this article, I will walk you through the process of exporting and importing content between two WordPress websites. The procedure is simple and does not require any technical knowledge.
You need access to both websites in order to migrate the content successfully. Additionally, I strongly encourage you to take a back up of the database of both websites so that you can restore them if something goes wrong.
How To Import Posts & Pages From One WordPress Website To Another
Exporting Content To Another Website
The core version of WordPress (i.e. with no plugins installed) has export functionality built-in. You will find the export feature in the main WordPress admin menu in the Tools section.
There are three options available. The first option backs up all content including posts, pages, comments, custom fields, categories and tags.
Alternatively, you can choose to only export posts or pages. You can filter what is exported and only export content from particular categories, authors, date range and publication status.
The export function will also list any other post types that your website uses. For example, I use the Ninja Popups plugin on my personal blog to display pop up messages. As this is a custom post type, WordPress gives me the option of exporting the content for that post type to another website.
Once you have decided what content to export, save the XML export file to your computer.
Importing Content From Another Website
The WordPress import options can also be found in the main admin menu under tools. Import functionality is not built into the WordPress core, however there is a good reason for this.
In total, WordPress provides eight official import systems (many unofficial importing plugins are also available). Therefore, WordPress offers these import systems as plugins so that the core version of WordPress is not bloated.
As we are importing from another WordPress website, we need to install the WordPress installer. You can do this manually by downloading the plugin from the official plugin directory. A more practical solution is to click on the WordPress link on the import page. This will bring up a pop up box that allows you to install the plugin directly through your website.
Once the plugin has been installed and activated, you will be taken to the import page. This is where you upload the XML file you exported earlier.
You will then be given the option to assign imported authors to existing authors on your website. This is useful if the same authors exist in both websites. Alternatively, you can create a new account for each author’s posts.
This page also has an option for downloading attachments. When you select this, WordPress will attempt to import all of the images that are attached to the posts and pages you are importing.
That’s all there is to it. Your content will now be imported into your website. You can verify this by checking your posts and pages.
All information will be identical to what it was before. Therefore, posts and pages will have the same publication date and be assigned to the same categories.
Whilst the WordPress importer can be used to migrate all content from one website to another, it is not an ideal solution for transferring a full website to another location as website settings are not transferred.
You should also be aware that the WordPress file upload limit is applied to the WordPress importer. This default upload value is defined by your hosting company. Sometimes this limit is 8MB, sometimes it is as low as 2MB. This can cause difficulties when you are importing a large number of posts and pages.
To address the issue, you need to increase the maximum file upload limit. This can be done in a number of ways including modifying your theme functions.php file, modifying your .htaccess file, and editing the php.ini file. Do not worry if all of this seems too technical.
The best solution is to ask your hosting company to increase the file upload limit for you. If they refuse to do this, you should probably review your hosting situation 🙂
Should any part of the import process go wrong (such as importing the wrong content), simply restore the importing website using the backup you made earlier. This allows you to start the import process from scratch and ensures that everything goes the way you want it to.
If you found this tutorial useful, I encourage you to subscribe to Elegant Themes and get our latest posts delivered to you via RSS or your favorite social media service.