This chapter is from the book

This chapter is from the book

Importing and Exporting Content

Suppose you want to move your content to a new site or make a backup of your posts and pages. Or you have content from another site that you’d like to add to this site. Is it possible? Absolutely, just use the Import and Export functions. We’ll start with Export for this example. Go to Tools from the side menu, then Export (or click Tools, then choose Export), and you’ll see a screen like Figure 11.60.

Choose what you’d like to export (I’m going to choose all the content for this example), and click Download Export File. In a minute or two (depends on how much content needs to be exported), WordPress will tell your browser to download the file (Figure 11.61), and if you want to open it, you can. It’s just a text file in XML, but it isn’t intended for people to read. WordPress export files are designed for WordPress or other CMS systems to read on import.

What if you wanted to import that content? Simple, just use the Import tool. Now there is a trick. The first time you use Import, WordPress needs to install and activate the Importer plugin. Here’s how that works.

First, click Import under Tools, and then click WordPress (assuming you’re importing WordPress content; for another CMS, choose that one) (Figure 11.62). You’ll see the Install plugin screen (Figure 11.63); click Install. After it is installed, click Activate and Run Importer (Figure 11.64), and you’ll come to the screen where you can click to pick a file (Figure 11.65). I’m using the file we just exported, in case you’re wondering. After you click Choose, and then Upload file, you’ll come to a screen that will let you match the content to an existing user or create a new one (Figure 11.66). I chose to map to the existing user (me), but if you’re importing a lot of content, it’s a good idea to let WordPress create a new user. Then you can sort the content by user in the All Post or All Page views and go through it. You already know you can use Quick Edit and Bulk Edit to quickly change a piece of content’s author, so the content you keep you can transfer to yourself or another user. The last screen shows the results of the import (only the bottom). In this case, because I was just importing the same content I just exported, WordPress didn’t import duplicates (which is helpful) (Figure 11.67).

WordPress is designed so that you aren’t locked into using it forever. You can always export your content to move it to another CMS. This is especially important when we talk about WordPress.com. If you start with WordPress.com and decide later to switch to hosting your own site using WordPress.org, you can quickly and easily move all your content from one to the other with just a few clicks—including all the images!