Over the years I have been asked to move WordPress blog posts many times. The most frequent need for blog post migration is during the development of a new site where the client needs to keep all blog posts, but has no need for other things from the old site. Instead of migrating the entire live site database, it is much cleaner to ONLY move the blog posts so all the other extraneous database stuff (pages, plugin data, other meta data) doesn’t clutter the new site’s database.
The simplest way to migrate blog posts is to use the built-in WordPress export/import functionality. It works very smoothly and is simple to do. The problem is, when you export ONLY posts, or anything less than “All Content”, the featured images are not included with the export.
For sites with a small number of blog posts you could always manually add the featured images, but that is tedious. Plus, for sites with a significant number of blog posts, this can prove to be a very large task. So, here is a quick and easy way to migrate blog posts while keeping featured images in place.
Exporting the Blog Posts with Featured Images
- Install the following plugin on the site you will be exporting the blog posts from and activate it:
https://wordpress.org/plugins/export-media-with-selected-content/
- Go to ‘Tools -> Export’ and select ‘Posts’ and check the ‘Export Media with Selected Content’ as pictured below:
- Click the ‘Download Export File’ and save it to your desktop.
Importing the Blog Posts with Featured Images
- Go to the new WordPress installation that you’d like to move the blog posts to and go to Tools -> Import.
- Choose WordPress and install/activate the WordPress Importer plugin.
- Import the file you saved to your desktop in step three and you’re all set!
With the help of this simple plugin you can easily migrate blog posts while keeping the featured images in place. Here are a few tips to keep in mind:
- If you have a large number of blog posts it is good to export them in batches to avoid timeouts. I suggest doing them in 3 or 6 month batches. You can do this by changing the date range during the export process and then importing the files one by one on the new site.
- Be sure to properly assign/import the post authors when importing. This will ensure all authors for your posts remain consistent with your previous site.
- Make sure to move any images that are within the content of the post to your new site via FTP and ensure the URL to that image is correct. You can move the entire wp-content/uploads folder to ensure all images stay in place, but I prefer not to do this so the new site is as clean as possible.
Hopefully this simple tutorial can help you save some time on your next migration. If you have any questions or tips, leave them in the comments below!
Hi there! I am not seeing any options to export media or to export media with selected content.
Hey Kathy,
Have you installed and activated the plugin as outlined above?
Matt
u need this https://wordpress.org/plugins/export-media-with-selected-content/
Hey Mel – that is precisely what this blog post outlines! 🙂
The plugin does not work for me. When I click to export the file it does not download, it just kicks me to my site’s homepage.
I haven’t used it for quite a while so it is possible the plugin needs updating. Or it could be a conflict with another plugin, or an issue with your site or host. I would suggest enabling the PHP debugging and see if it outputs any PHP errors when you export the file. That would be a good starting point.
Matt
Exporting posts within a date range results in no blog posts within the .xml export file.
Are you sure you have posts in the range that you’re trying to export? Exporting by date range is how I’ve done it on multiple sites with a large number of posts to ensure the export doesn’t time out.
I have imported all posts into the new blog (new site) successfully but I was not given the option to import the media. The images are showing up but I believe they are still being hosted on the old site (new site is still on my machine – localhost). If I import all the media from the old site is there a way to have the new blog pull from newly imported files? Thank you
Hey Amy,
There is no “import media”. It is exported using this method and automatically imported when you import the file in to the new site.
To check if the image is looking at the correct site you can go in to a browser like Chrome or Firefox, right click on the image and click ‘inspect element’. Take a look at the URL and see if it is pointing correctly.
You could move the entire ‘uploads’ folder over…but that won’t attach the images as featured images like the method in this post will. With that said, if you do have images within the body of your posts, you will need to move the uploads folder and also do a find/replace to swap out the URL on those images to point to the correct URL.
Hopefully that all makes sense!
Cheers!
Matt
Hi Matt,
Thank you for the reply. The site is still on my machine, when I open an image in a new window, the url starts with: https://res.cloudinary.com – ?
Without looking at your setup I don’t know that I can be of much help here and since it’s on your local machine I can’t do that. I’m not sure what that URL is and how your local install is setup so it could be fine, or you may have done something wrong. :-/
Would really appreciate your help – tried to use this but when I import in the new site it says all images have ‘failed’. They’re all feature images – any ideas?
Hey Alastair,
Unfortunately, this probably isn’t something I can help with. There area variety of things that could cause this. Your hosting/server setup, possibly the files are already where you are importing them, the import may be timing out. I would suggest reaching out to your hosting provider or posting a message on the plugin support forums for some guidance from the plugin developers.
Best of luck!
Matt
I had this same issue as well. All of the blog content imported except the media. After the import I received “Failed to import Media” notifications.
I know this would be very hard to debug but any updates on this issue would be greatly appreciated!
Worked like a charm for us. Ran it on about 170 posts. Thanks Matt!
Great news!
Does not work. says
The webpage might be temporarily down or it may have moved permanently to a new web address.
can you help please? many thanks
I’m not sure what you’re referring to. The link to the plugin looks fine on my end.
If i enable the “Export media with selected content” option when i go to export, the downloaded file is 0 bytes and empty. if I uncheck “Export media with selected content” in the export screen, i get a good xml file. is there anything that can be done to fix this?
Hey! You’d probably want to first try deactivating other plugins and see if it works to see if there is a plugin conflict. You could also make sure all your plugins/themes and WordPress are up to date. As a last resort you’d want to reach out directly to the plugin developer to explain what is happening. Without knowing your setup I don’t know that I would be too much help on this one! Cheers!
Matt
Exports everything fine EXCEPT for the featured images, which is what it says differentiates it from the standard WP Import/Export. Unfortunately of no use to me.
I’ve used it as recently as two weeks ago without issue. Sorry it isn’t working for you. Maybe contact the plugin author if you’re having issues.
I have exported and imported 100 blogs in my days and NEVER have I been successful in bringing the media over. I can do the sub “year” folder transfer and that takes care of the media in the content, but the featured image has never, on any server, at any time, imported to the blog. I have tried multiple plugins and different exports / imports, but it always results in an empty “featured image” for each blog post. Clicking the “media” option in the export does NOT do anything. It never has. So needless to say, you did not answer any of my queries with this post. Thanks anyways.
I have also migrated over 100 blogs in my day and this plugin has worked wonders to include featured images. I will admit I haven’t used it in a few months, but as of Feb/Apr 2018 I used this without issue. Doing it in batches to have smaller import sizes helped. Leaving a snarky comment because you can’t get it to work isn’t going to help you out…
This works for me, but I have to do it in one-month chunks due to server timeout (which is a pain as I have a 10-year archive!). It will allow me in larger portions, but I have to run the importer once or twice over on the same file to get it going.
Yep, same here. Depends on your hosting provider and how well their server performs as well. I’ve always found smaller chunks is the safe way to go (but can be a bear if you have that many posts!). Glad it works!
For an alternative approach, I’ve built a python application that lets you transfer just the content of a site from one site to another using the REST api. Its all open source so, hopefully its useful 🙂
https://github.com/robrab2000/WP-REST-Migrator
Good tip – I’ll have to give this a try some time.
Pls, is there an alternative plugin to this today?
Even though this plugin has not been updated over 2 years ago, this did successfully work for me. This guide was easy to follow and right down to the point.
I am moving my WordPress website from a self-hosted to now being on WordPress servers in which this did successfully work.
Its 16-10-2018 I have tested this plugin with my latest word-press site and works like a charm all posts with their relevant featured images are shown plus its download the featured images in word-press folder. I have import and export 100 posts.
Thanks
This plugin didn’t do anything as far as I can tell. What I ended up doing is going directly to the database tables (via PHPmyAdmin) and exporting the SQL for wp_posts and wp_postmeta. I exported “Structure and Data”, “Add ‘drop table'”, and “Complete Inserts”. Then I did a search and replace in the resulting SQL file for the old/new domain. Then I ran the SQL in the new WP database. That is the only way I could restore featured images. The images were uploaded via FTP. Then I use a plugin called “Add from Server” to essentially re-import the images into the media library. It’s a lot of work.
Seems like this plugin is hit-or-miss sometimes. I have personally never had any issues, but a lot of others have. Lots of work using your method but if it got the job done, great! I’ve used “Add to Server” many times in the past to get media uploaded via FTP in to the media section – great tip there. Cheers!
When I use the plugin, and click ‘download export file’ I get the message: ‘can not find URL’.
What can this be?
Thanks!
Your best bet is to reach out to the support for the plugin. Could be a plugin conflict, outdated version or WordPress, theme conflict, etc…lots of variables.
Hello, i am trying to use this plugin, it is working perfectly with small data’s, but i have 7500+ posts and just my uploads folder images 7gb. when i try just posts author by author or date by date or category by category i got error browser “Tmeout” i changed my php.ini max limits even my timeout limit now 0 mean limitless, my wordpress 4.9.8 and my php version 7.2. , i am trying to export my posts with deatured images. Can you help me? Do you have any solutions or any idea?
I would suggest doing them in very small batches. Like 1-2 months at a time. That will help with the timeout issues. Outside of that you would want to reach out to the plugin author for support. Best of luck!
wooow it worked,
thank you
I just used this method and it broke my site.
I downloaded the plugin and imported only a few posts to test this and now my entire website won’t even load.
Has this happened to anyone else?
does it all exports and imports and blogs categories and users ?
It works like the default WordPress import/export. It will give you an option to import users or assign posts to other users. It will import categories.
So funny to find this when I was looking to move the featured image for my client. You saved me again Matt! You are awesome!
Small world! Glad it helped (hope it works – it is a bit dates but still seems pretty stable!
Only the posts were imported without any media and featured images. No error as well while importing.
Please see previous replies for some troubleshooting steps or contact the plugin author.
what if all you have is the GIANT export with media images but you didn’t do it in batches and you don’t have access to the old blog anymore to do that.
I keep timing out if I try to add images. Am I out of luck and just have to do 10 years of images again?
Hey Michy. Your best bet would be splitting up the XML file in to smaller files (you’d need top open it up in an editor and carefully create multiple files). It would be tedious, but may do the trick for you.
My problem is I have to move a WORDPRESS.COM website. So i cannot install any new plugin unless i pay 300usd a year.
So i can only try stuff with the import feature in the new server or with the xml files.
Is there anyone who can help? Thanks!
You can only export posts OR media. You cannot export both at the same time. Do you have an updated solution?
I used this method about two weeks ago and it worked fine for both…but, a much more robust solution is WP All Import / Export PRO. It isn’t free, but works great.
Hey! Great article/very informative however I have a more personalized questions that I wonder if you can answer… I already have a domain name & host using wix & godaddy but I want to create more customized blog posts… is it possible to just use wordpress for blog creation alone & then transfer those blogs over to my wix site? I’m just trying to sort through the best option in combining wordpress & wix… thanks in advance!!
Hey Gina,
Sorry for the delayed response. I don’t use Wix for anything so I don’t think I’d be of much help. Maybe reach out to Wix support and see if this is doable!
Cheers,
Matt
Thanks for this great tutorial. It really helped me a lot. Thanks again.
Worked for 245 posts and images. In one batch. Thanks so much!
It not working for me !!, When I Import content it not import media
Thanks for this tutorial. When I try to export I get 502 Bad Gateway error after a little while. Why is that?
Hey Alain,
My first guess would be maybe you are exporting too many posts at once. Try limiting the number of posts by selecting a smaller date range.
Best Regards,
Matt
I got “Failed to import Media ” error. 🙁
I’m having the same issue as others where if you select a date range the XML file doesn’t include the posts but if you don’t select a date range it works fine. It’s annoying but you can still open the XML file and split the posts up into multiple XML files manually to avoid timing out during upload.
Thaks for the tutorial, it worked for me, I had a bit issue but was able to figure the rest out.
Hello Math,
I tried the plugin. But exporting gives files of only 3kb. I followed your tutorial exactly. Is this a familiar problem?
Kind regards, Vincent
Not that I am aware of. I literally used this method to move roughly 300 posts two weeks ago and didn’t have any issues. A 3kb file sounds like it isn’t exporting any content, so check your date ranges maybe.
I’ve bookmarked this for future client projects, thanks
Thank you for this detailed and simple tutorial.
You saved me a lot of time!
Simple but strongly effective Matt, It helps me a lot with the migration process.
Keep sharing, Thanks.
Thanks Matt. This has been a frustration for ages. Maybe I wasn’t Googling the right term for Importing Featured Images into posts. Anyway, it works and it was really quick and I’m very grateful. 🙂
This is the only method that has actually worked online for me. And I’m a 20 year veteran developer. This is wild!