2

I'd like to move a set of posts from one wordpress site to another.

WordPress has a native export tool that allows posts to be exported. But this tool doesn't preserve featured images.

I'm aware that the WordPress Importer plugin provides an option for importing the featured images. But over the year that I've used this option it has never worked for me.

I've found a couple of plugins in the repository. But they are old, untested on later versions of wordpress and I can't get them to work with the current version.

Ideally I'd like to import both the featured image and any other media attached to posts.

1

2 Answers 2

9

You can consult this answer, but the instructions are a bit unclear, so I'll clarify them myself here.

  1. On the old blog, export the posts using the standard WordPress import/export functionality. If you're unfamiliar with that, see this link for more information: https://codex.wordpress.org/Importing_Content
  2. On the new blog, use the WP Importer to import the XML file generated when you exported the posts from the old blog, but do not click "Download and import file attachments". You'll be doing that in a later step. Import the posts.
  3. On the old blog download Export Featured Images. As of this writing the plugin DOES work with WP 5.1.1. I just tested it.
  4. Once the plugin is installed, go to Tools > Export Featured Images.
  5. Select "post" if you want blog images
  6. Click export. You'll download another XML file
  7. On the new blog, visit the WP Importer once again.
  8. This time, click "Download and import file attachments", then click "Submit"

This will assign all the featured images to the existing posts.

If you download and import file attachments in the first import, it will stop the second import from working.

Good luck!

6
  • > "do not click "Download and import file attachments" I didn't click this yet still received an error saying "Failed to import media attachment". I also received the same message during step 8 and no media was imported.
    – Jonny
    Jun 19, 2019 at 15:41
  • 1
    This works to import/attach the Featured Image of each post. But it does not include inline images, and I can't do a 2nd-pass with 'Download and import file attachments' ON, because the wp-importer knows the post were already imported. How can we import BOTH inline and featured images?
    – tzeldin88
    Jan 27, 2020 at 0:22
  • 1
    Tested this with WordPress 5.5 and it still works. Thanks for saving me hours of writing code
    – Atif
    Jun 15, 2021 at 22:39
  • 1
    5.8 Still works... Life Saver Thanks
    – Flipmedia
    Sep 14, 2021 at 20:13
  • 1
    Thank you, I don't know why this just doesn't work out of the box...
    – Mike
    Nov 5, 2021 at 14:13
0

You can easily export the posts and pages using the export built-in function of wordpress. If you want to export the local posts, you will get in trouble, this because wordpress will import only the media files that are available online, this means that localhost will not work.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.