• Get In Touch
May 30, 2017

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:

  1. 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.
  2. Import data exported from a blogger/BlogSpot platform. Blogger is a popular blogging platform owned by Google.
  3. Import form LiveJournal, Movable Type and Tumblr blog.
  4. 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:

  1. Head over to the plugins portal and type ‘Wordpress Importer’. Hit enter.
  2. Click the ‘Install Now’ button.
  3. Click the ‘Activate’ button.
  4. 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:

  1. In the tools menu item, click the Export button.
  2. 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.
  3. 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.

  1. 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” />

  1. Simply browse the XML file.

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

  1. Click ‘Upload and Import file’ button.

  2. 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” />

  1. 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.

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

Share this Article!

Related Posts

Node.js Authentication – A Complete Guide with Passport and JWT

Node.js Authentication – A Complete Guide with Passport and JWT

Truth be told, it’s difficult for a web application that doesn’t have some kind of identification, even if you don’t see it as a security measure in and of itself. The Internet is a kind of lawless land, and even on free services like Google’s, authentication ensures that abuses will be avoided or at least […]

Node.js and MongoDB: How to Connect MongoDB With Node

Node.js and MongoDB: How to Connect MongoDB With Node

MongoDB is a document-oriented NoSQL database, which was born in 2007 in California as a service to be used within a larger project, but which soon became an independent and open-source product. It stores documents in JSON, a format based on JavaScript and simpler than XML, but still with good expressiveness. It is the dominant […]

Using MySQL with Node.js: A Complete Tutorial

Using MySQL with Node.js: A Complete Tutorial

Although data persistence is almost always a fundamental element of applications, Node.js has no native integration with databases. Everything is delegated to third-party libraries to be included manually, in addition to the standard APIs. Although MongoDB and other non-relational databases are the most common choice with Node because if you need to scale an application, […]

Node.Js Vs Django: Which Is the Best for Your Project

Node.Js Vs Django: Which Is the Best for Your Project

Django and NodeJs are two powerful technologies for web development, both have great functionality, versatile applications, and a great user interface. Both are open source and can be used for free. But which one fits your project best? NodeJs is based on JavaScript, while Django is written in Python. These are two equally popular technologies […]

Nodejs Vs PHP:  Which Works Best?

Nodejs Vs PHP: Which Works Best?

Before getting into the “battle” between Node.js and PHP we need to understand why the issue is still ongoing. It all started with the increased demand for smartphone applications, their success forcing developers to adapt to new back-end technologies that could handle a multitude of simultaneous requests. JavaScript has always been identified as a client-side […]