WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to move someone else's WordPress blog to a new server. I only have access to the exported XML file of the blog. When importing the XML with the Wordpress Importer plugin, everything went fine except for importing the images.

It seems the authors of the blog did not use the built-in upload functionality to add images to a blog post, but uploaded them separately on the server.

I was able to download all the images referenced in the blog posts and store them in the "uploads" folder, so all images display correctly on the new server.

However they don't appear in the media library and thus I can't access them in the code of the new theme.

So my question is:

How do I scan all blog posts for image references and add them as attachments?

share|improve this question

I'm in the process of developing a media tools plugin. One of the tools is an import as attachment that goes through the content of all your posts, pages or custom post types and imports and attaches the images to the media library. It also changes the url referenced in the content to the new url created by the import.


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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