When you use the basic WordPress XML Export/Import tool to migrate blog posts between two WordPress sites, their featured images will likely not be included, as silly and counterintuitive as that sounds. In this post by Morten Rand-Hendriksen, he offers one possible solution: “Instead of setting Statuses to ‘Published’ I set it to the default ‘All Statuses'”. Recently (on Feb 7, 2017) I tried doing just that though, and the featured images still were not exported. The solution that ended up working for me after after some searching and trial and error is outlined below. Note that doing it this way only works if the post IDs from the site the posts originally came from are identical (have stayed the same) as the post IDs on the destination site.

  1. Use the WP Export/Import tool to migrate the posts, knowing that the featured images wont’ be included.
  2. Install and use the Export Featured Images plugin on the site the featured images are coming from. After activating, you’ll need to go to Tools > Export Featured Images and choose which post types to include. It will export an XML file that you can import into the other site using the WP Import tool. Then just do a spot check on your posts to make sure their featured images have been both imported and attached to the correct posts

 

Another possible solution would have been to export ‘All content’, which does include featured images, then manually edit the XML file and delete everything you don’t want included. This is tedious and prone to error though, so I wouldn’t recommend it.

Beyond the things mentioned above, a more robust migration script could be used, but that seems like overkill to do something as simple as migrating Posts from one WordPress site to another.

15 comments

  1. Zoli Hari April 20, 2017 at 5:26 am

    Reply

    Hi Kellen,

    This is the error message I get when I try to do the same:
    Notice: wp_get_http is deprecated since version 4.4.0! Use WP_Http instead. in /var/www/vhosts/***/***/wp-includes/functions.php on line 3829
    Failed to import Media “visual-arbeiten-bei-bosch”

    Since your article is only 2 months old, I would still expect it to work, but looks like it doesn’t. Do you have idea why?

    Thanks,
    Zoli

  2. Shu June 27, 2017 at 3:42 pm

    Reply

    This doesn’t work in my case. I am using NextGen Gallary to show featured images and my exported xml file was empty.

  3. Mirela July 3, 2017 at 3:48 am

    Reply

    Hi there 🙂
    How long did it take to import?
    There is no status bar, so I don’t know if its working or not.

    • Kellen Mace July 17, 2017 at 6:33 am

      Reply

      Mirela – that would entirely depend on how many posts and featured images you have. It would only take a second if you had a couple, and could take much longer if you had 5,000 posts. Hopefully you don’t have to wait too long 🙂

  4. Are Hansen August 4, 2017 at 10:45 am

    Reply

    Wow, thank a lot! It worked like hell when I finally clicked the right options. Brilliant, very useful tool!

    I love open software and freeware. There is always someone somewhere who’s had the same problem, and found a solution

    Are,
    Norway

  5. Kasia September 22, 2017 at 10:55 am

    Reply

    Sadly this did not work for me. I received a “Failed to import Media” error after the import for all of the images. Too bad, it would be a great tool if it worked.

    • Nick January 23, 2018 at 11:23 am

      Reply

      If it’s not working for you, perhaps try WP Site Importer (https://www.wpsiteimporter.com). It’s a really easy way to migrate content, menus and images from any website. You just enter a URL and it does all the work.

  6. asd October 30, 2017 at 3:01 pm

    Reply

    Doesn’t work

  7. Orlando Ferreras November 4, 2017 at 11:03 am

    Reply

    Amazing post, Kellen. I was losing my mind about transferring to another site near 400 entries, however you’ve just saved my life. Everything worked perfect! Much appreciated!

  8. Varun February 11, 2018 at 5:30 pm

    Reply

    does not work, Please work

  9. Nathan May 9, 2018 at 3:11 pm

    Reply

    Worked great for me! It took a couple minutes to run the import because it had to download the original images, which were large. I only had about 20 posts to import. Thanks!

  10. Robert Butterworth (work)_ July 23, 2018 at 7:13 pm

    Reply

    One thing I love about wordpress is comments like

    “it didn’t work”

    Thanks for the help and intelegent input

  11. Tomas July 31, 2018 at 8:30 am

    Reply

    Well, for me it showed that most of the media already existed. But after the process was completed all of the featured images were reconected to the original posts. Just what I needed! Thank you!

  12. Andrew September 28, 2018 at 8:50 am

    Reply

    Thanks! This saved me a bunch of time 🙂

  13. Edward October 12, 2018 at 11:16 am

    Reply

    Thanks Kellen for this plugin, it’s very helpful.

Leave a reply

Your email address will not be published. Required fields are marked *