WordPress: Import/Export Posts in Bulk

Using Wordpress? Get our lightening fast Wordpress Optimised Hosting. Get Wordpress Hosting

Everybody knows that content, or rather more generally data, is king. It’s what is driving the web. It’s what the web is all about. The web was built to exchange and share content. People go to the web because of content. Pretty much all websites out there work with some form of data. 27% of web is said to be powered by WordPress, a popular Content Management System. So in short, Wordpress is simply a platform that manages content, or data.

This implies that without content Wordpress would be nothing. The web would be nothing. Seriously, what would the web be without content? It seems to me that almost everything, or even all software, or even computers, is just a matter of data manipulation. Data is all that powers any given system or piece of software.

We humans have been creating content and recording it since time immemorial. Articulating our knowledge and passing it to generations or sharing it is a human need. Ancient civilizations made scribes of their experiences and knowledge in massive tomes. In our generation, more and more content is finding its way to the web. Be it in form of eBooks, via blogs or content management systems.

It’s therefore imperative that we don’t lose our data. We have to find a way of always backing up our data. This is the purpose of this lesson. We want to see how to back up our posts with one click of a button. There are full blown backup services and plugins out there, however, we want to start with using the simplest backup method. Simply exporting the posts into an XML file.

We will also explore how to retrieve them. This may sound too simplistic I admit. However, it’s something we can do in seconds. Yet it backups the most important piece of information we have which is our actual content. Themes, plugins and settings are always fine, however, content is the king as we have said. The former is always there waiting to be downloaded and installed.

However, if we lose our precious data, we are talking about losing years of hard work.

Objectives

So what then is the objective of this lesson? Well:

Import from and Export our posts, comments, tags, categories, authors etc. to an XML file. This XML can easily be shared across sites. In short we can not only backup posts but also share them across multiple wordpress websites. Import data exported from a blogger/BlogSpot platform. Blogger is a popular blogging platform owned by Google. Import form LiveJournal, Movable Type and Tumblr blog. Import RSS feeds.

Pre-requisites

Our only pre-requisite is to have an already working wordpress installation. It doesn’t matter whether it’s hosted locally or remotely. We’ll also install a plugin so you may require an internet connection for that.

Advantages of Wordpress Importer

We’ll be using the Wordpress Importer plugin. Why? Well, because:

It’s free and easy to use.

It’s very popular with over a million downloads.

It supports both posts and custom posts. Moreover, it can import and export these two along with their associated comments, tags, categories, authors and custom taxonomy terms.

It attempts to prevent duplicates by checking if the post already exists before importing.

It allows us to re-assign authorship of a given post.

It’s fairly fast.

Installation

Wordpress Importer plugin is available in the wordpress plugins repository for free. So:

Head over to the plugins portal and type ‘Wordpress Importer’. Hit enter. Click the ‘Install Now’ button. Click the ‘Activate’ button. That’s it.

Importing Blogger, LiveJournal, Movable Type and Tumblr

To import posts from the above blog platforms, you need to first install the corresponding plugins as shown below.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/1598903818.png" alt="Install Plugins" />

Then click ‘Run Importer’.

It shows us the page for browsing the blogger xml file. Select it and click upload.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/1496894299.png" alt="Import Blogger Posts" />

With the LiveJournal you have to connect to their platform as shown below.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/669272604.png" alt="Import LiveJournal Posts" />

With the Movable Type and Typepad, you can either import the XML file or Text file. As you see it informs us that it can take care of duplication, so don’t try to import everything at once. You’ll run out of memory. Instead chunk the file.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/2057361497.png" alt="Import Movable Type" />

With Tumblr, please take your time and register then create an app. You then bring over your OAuth Consumer and secret keys and enter them as shown in the below fields.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/98855167.png" alt="Import tumblr Posts" />

RSS is pretty easy. Just browse the RSS file and click ‘import’ button.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/1572214817.png" alt="Import RSS" />

Exporting Wordpress Posts/Custom Posts

To export your wordpress posts:

In the tools menu item, click the Export button. You can export everything, all content, that is posts as well as pages, menus etc. You can also import pure posts alongside their associated Meta data like tags, categories and author. In this lesson we are importing only posts. You can export posts in specific categories, tags or date. In this lesson we export all posts. Click the ‘Download Export File’ button. Wordpress Importer shall generate a ‘WXR’ file, that is a Wordpress eXtended RSS file which we can later import.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/161574313.png" alt="Export Wordpress Posts" />

Importing Wordpress Posts/Custom Posts

It’s pretty easy to import posts or custom posts in wordpress.

In the tools menu item, click import, then click the ‘Run Importer’ under wordpress. Our assumption is that you’ve installed the Wordpress Importer already. We explained that in the ‘Installation’ section above.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/667883515.png" alt="Run Importer" />

Simply browse the XML file.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/132296396.png" alt="upload the XML File" />

Click ‘Upload and Import file’ button. Assign the author of the posts. You can also just import the posts alongside their original authors.

HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/1341803527.png" alt="Assign Authors" />

That’s it. HP_NO_IMG/data/uploads/users/a4c0adcd-8650-4b65-9b01-9dd628e70757/1543352460.png" alt="Import Done" />

Our posts will get imported. Note that if you are importing custom posts then create the post type before importing. Wordpress Importer is not meant to create for you a custom post type, it’s meant to import to an already existing post type.

I imported slightly over a hundred posts in almost a minute, so that’s not a bad performance in my opinion. It does check if a post already exists. The best thing is that it skips it if the post exists. It doesn’t quit. So you avoid a lot of duplicates and can also run it multiple times.

Conclusion

So that’s it, importing and exporting posts. Seems a very simple feature yet quite important. Never should anybody totally lose posts. Obviously this is not a replacement for a proper website backup, but it can supplement one.

This is also something you can do regularly. You can specify a category or tag and generate the backup file. Moreover, you can choose a date range.

Transferring posts between websites has never been so easy. In fact, it’s not that easy in other platforms. Wordpress makes it a piece of cake. It’s even possible to import from other platforms like blogger and tumblr. You can import custom post types too. However, make sure you create the post type before importing. All in all, I have used this plugin to import hundreds of posts in my personal blog, it has saved me a lot of time. It can save you too precious time.