9

I have used Tools->import&export but it didn't work. I have tried using Wp-All-Import and Export plugin then also it is not working. Only the content imported not the images. How to fix this issue. Is there any way to import posts with images?

  • see this article here, they mentioned how can you import/export featured images – Arsalan Mithani Feb 20 '17 at 13:21
  • 2
    How many posts do you need to import export? the thing is, you can use WP default import export and just leave to do it's work, It will take a while for the images to get imported so give it time. Option B would mbe to export /import all media files and then proceed with posts. – Marko Jezernik Feb 20 '17 at 13:26
  • Hi.. Not only featured images. All images in post are not importing. – Padmini Maddur Feb 22 '17 at 6:19
6

Use Export Featured Images plugin that let you export Featured images from posts or custom post types into a WordPress xml so you can import them in other sites using the WordPress importer tool.

https://wordpress.org/plugins/export-featured-images/#description

How to use??

  1. First, import your posts to the new site.
  2. Use this plugin in your old site and go to under tools > Export Featured Images and select post types. Then you will get a .xml file.
  3. In your new site go to Tool and select wordpress import. Then select the .xml file which you downloaded in the previous step.

That’s all.. Your posts are mapped with featured images. Enjoy!

3

Why images don't get imported

It's the export step that causes the issue here with image attachments. WordPress’ export function doesn’t include the “attachment” post type unless you select the “All content” export option. But if you only want to import and export your posts from one site to another, you lose your attachments. There is more information about the why of this here.

How to get images into your new website anyway

So if you're only exporting and importing posts, one option is to move your images manually. But that's potentially a lot of work, especially on larger sites. The other option is to import you posts without the images, and then use the Auto Upload Images plugin to add the images afterwards. This plugin does several things:

  • It looks for image URLs in your posts (imported posts do still have image URLs in them, but they point to the site the content was exported from);
  • It then gets those external images and uploads them to the local WordPress uploads directory and adds the images to the media library;
  • And finally, it replaces the old image URLs with new URLs.

The process is semi-automatic and relatively quick. You can uninstall the plugin again when you're done, so you're not left with an extra plugin on your website. Using the plugin for this purpose isn't explicitly documented in the plugin's documentation, so here is a step-by-step guide.

Step by step: Importing posts and images from one website into another with the WordPress Importer and Auto Upload Images plugin

Step 1: Prepare your export file on the old site
On your old website go to 'Tools > Export' and export your posts only.

Step 2: Import your posts into the new site
On your new website go to 'Tools > Import' and import the posts you exported. The importer has an option to download and import file attachments, but this won't work if you're not migrating all content, so you can ignore this.

Step 3: Install and activate the Auto Upload Images plugin
It installs as any other plugin in the WordPress repository. Once activated the plugin adds a settings page under 'Settings > Auto Upload Images', but in my experience you can leave these to their defaults.

Step 4: Get the image from your old site into your new site
At the time of writing the plugin has no option to automatically go through your posts and bulk upload plus update all the images. Instead, it updates each post individually when you save it. If you have many posts this is a lot of work, but there is a little trick. You can go to your posts overview screen and bulk update your posts. There is a little more information on this here (useful note on multisite).

Essentially, you select multiple posts and then under 'bulk actions' choose 'edit' and press the 'apply' button. Then, without making any adjustments, click the 'Update' button. Depending on your server you may get a timeout as the process runs, so it's a good idea to do this maybe 20 to 50 posts at a time.

Bulk-updating posts

Step 5: Check your posts and deactivate/uninstall the plugin
When all is done you can check your posts and confirm they now reference local images. You then no longer need the plugin and you can safely deactivate and delete it.

Final thoughts

Probably a good idea to make a backup of your new site first (at least of your site's database).

At the time of writing the Auto Upload Images plugin hasn't been updated for quite some time, but on testing it worked fine.

With this method all images in posts get imported, not just featured images.

  • Great answer. Works perfectly. – Chris Jan 22 at 16:53
0

There are multiple ways you can do this:

  • Manual
  • Using plugin

For manual, it's a little more lengthy process, you need to download complete files from one server and upload it to another. Do some changes to the backup DB i.e replacing urls and then uploading the DB file as well.

Other way, which is far more better is to use the plugin called as "All in one Migration". Here is the link which can guide you on the complete process:

https://makersbyte.com/easily-export-import-wordpress-sites/

0

I am the best person to answer this question as I was facing the same issue while importing. The problem is not actually in importing.


It is in exporting. When you export all content then you import with attachments that XML file all your images will be download but when you export selected posts then import with attachments then only posts get imported. So to fix this there is a plugin which exports the right XML file that it does same like export all content XML file.

So here is the plugin https://wordpress.org/plugins/demomentsomtres-wp-export

This will create a new export option just like default WordPress export GUI, but with advanced features so that when you import that XML file your media will be imported while importing that XML file(from default server to your local server). You don't need to install it in the Wordpress where you importing media, It just needs to be installed on the exporting server WordPress.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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