WP Export Posts

How To Export WordPress Posts (With Images)

Once in a blue moon you might find it useful to export your posts out of WordPress. It’s quite a straightforward process – but there are a couple of ‘gotchas’ to be very careful about.

This guide should help you decide if exporting posts is really what you want to do in the first place. And show you how to do it.

Important: ‘Export’ Is Not ‘Backup’

The first gotcha to be aware of is that exporting posts is not the way to backup your WordPress site. There is a lot more to a site than the posts on it. So a proper backup must include all files that have been uploaded (images, logos, pdf’s, spreadsheets, documents). Plus it must include a complete copy of the database. And any customised themes or plugins.

If a backup is what you really wanted, and you’re now a bit lost, then please contact us for WordPress technical support – we’ll be more than happy to help (you can also try our WordPress beginner help articles). It’s easy to get this wrong, and an incomplete backup will be just as useless to you as having no backup at all.

The WordPress Export Tool

WordPress has a built-in ‘Export’ tool, which can be found (after you login to the admin panel) in the main ‘Tools’ menu here:-

WordPress Export

It’s really one tool split into two options – first you ‘Export’ your content from one site, then ‘Import’ it into another. But depending on why you are exporting,  you may not need the import option at all.

Bear in mind this tool was really designed for moving content from one site to another, if for example you’re changing your domain name. It’s not suited to migrating hosting companies – because you need both the old and the new sites to be working at the same time (for reasons we’ll come to in a moment). And because you’ll also have to spend a lot of time fixing things because none of your settings (for anything, plugins, themes or WordPress itself) will be transferred over.

If what you really want to do is change website host, then ask us about our site migration service. It’s not an easy process so if you’re not 100% clear how to do it, this is best handed over to someone with experience. We’ve successfully migrated dozens of sites of all sizes, without any downtime.

How To Export WordPress Posts

OK, so once you choose the Export Tool, you get a few options:-

WP Export Tool Options

Exactly what you get here can vary depending on what plugins you have installed. But typically you will just leave the default option selected (‘All content’) and click the ‘Download Export File’ button.

DANGER (Where Are My Images!?)

It’s incredibly important at this point to understand exactly what you are downloading.

The file you get from this process will be an “.xml” file. You may never have come across that file format before. It’s a text based format (you can open it and read it in a text editor) which includes a lot of data.

It DOES include all the text of your post – and it will include all the headings, links, categories, date it was created, author etc.

But what it will NOT include is any of the actual media/image files.

It will include a link to those media files, but NOT the actual file itself.

TIP: Don’t be fooled by that ‘Media’ option under ‘Choose what to export’. This does NOT export the actual media/image files either. It just exports a .xml file that contains links to those media items.

How To Export WordPress Posts With Images..?

If you’re using the tool for what it was designed for – you don’t need to export the image files themselves. Because this is all handled by the Import Tool.

[If you’re not using the Import Tool, so need those image files too, skip down to here.]

The Import Tool asks you various questions about how you would like to import the data you have exported. One of which will be an option to “Download and import file attachments”.

If you choose that option it will fetch the images from your old site, add them to the WordPress ‘Media Library’ and update the images in your posts so that they now load from the new site.

If you don’t choose that option, the images will still be loaded from your old site. Which means if/when you shut that site down all of your images will be broken on the new site.

This is why you need both the new and old sites to be up and working during the complete import/export process.

NOTE: as I said above, if you want to backup your site, or move from one hosting company to another – this is NOT the way to do it.

What If You Need The Image Files Too?

If you do need the media files to go with the exported .xml file, then the easiest way is to simply zip the entire /wp-content/uploads/ folder and download that. Just be aware that there may be a lot more images in there than you were expecting, because each time you upload an image WordPress automatically creates copies of it in various different sizes (thumbnails etc).

You can normally just use the File Manager within your cpanel hosting to do all of this (just be careful).

What If It All Goes Wrong?

This stuff is not straightforward unless you’ve done it numerous times before. So if you end up with a broken website at the end, the first thing to try is restoring a backup of the site (you do have a backup..?). Your web host may be willing to help, but many won’t as they’re not really being paid to provide this level of support.

If you’re still stuck though, we can help you fix your site.

It’s OK to try fixing it yourself, but we recommend taking another backup before you make any further changes. Then if things get even worse at least you can go back again.

5 thoughts on “How To Export WordPress Posts (With Images)”

  1. The article should mention that the paths of the files and images need to be changed for the new website if the /wp-content/uploads/ folder is transferred over.

    Reply
    • If you use the Import Tool to fetch the images from the old site then you don’t need to update the paths. If you’re changing website host and therefore keeping the same domain then you are of course correct, but this kind of site migration is beyond the intended scope of what we’re covering here 🙂

      Reply
  2. Question – I want to move all my blog posts from my current live site to my subdomain (which will become my live site once I am done). Is there any behind the scenes risk to using the WordPress export/import functionality? My host took an inordinate amount of time to respond to a service request and now are discouraging me from using the export/import tool in WP. Is there anything else I need to know? I have played with it and for the most part media is coming across too with the posts and I don’t see anything apparently wrong. I am a novice and pretty turned around but I have done all this on my own for the past several years.

    Also, when I want to make the subdomain my live site, what are my actions? Can you tell me how to do that?

    Reply
    • I wouldn’t use the WP export/import functions for this. What you want to do is a site migration. We’d normally do this using a more technical process, but I’d recommend you use a plugin to make it easier. There’s one called ‘All-in-One WP Migration’ which generally works well. So your process would be:-

      1. Do a full backup before you do anything else 🙂
      2. Install the plugin and export (using the find/replace option to e.g. change yoursite.com/blog/ to blog.yoursite.com)
      3. Create the subdomain
      4. Install WordPress on the subdomain
      5. Install the plugin on the subdomain and import the file exported above
      6. Test everything
      7. Update any links pointing to the old location
      8. 301 redirect all the old urls to the new urls (using htaccess)
      9. Delete the old site

      Hopefully that gets you there, but contact us for help if you get stuck.

      P.S. Bear in mind it’s not actually part of a web hosts service to provide WordPress support (unless you’re paying extra for that) – so it’s nice that they provided some help, but their job normally ends at just keeping your web server online 🙂

      Reply

Leave a Reply to Elena Saygo Cancel reply