Import external attachments


Makes local copies of all the linked images and pdfs in a post, adding them as gallery attachments.

Source & support:


This plugin is based on the work done in the “Import External Images” plugin by MartyThornley.

HTTPS support added by IvanDoomer:

PDF support added by bengreeley:

Most of the JavaScript was rewritten from the original plugin, to reduce the
number of global variables.


  1. Download the “Import external attachments” zip file.
  2. Extract the files to your WordPress plugins directory.
  3. Activate the plugin via the WordPress Plugins tab.


How does this plugin work?

The plugin examines the HTML source of your post when you save it, inspecting each IMG tag, and processing them according to the options you have selected.

Under the default settings, it will find IMG tags with links to images on other web sites and copy those images to your web site, updating the IMG src to point to your copy.

PDF functionality was added by bengreeley.

Does it work with MultiSite?

Yes! It was developed and built (and is used everyday) at – a multisite install.

What if i don’t want to import images from a third party image hosting site?

You can make it ignore any domain you want on the settings page, in case you work with a CDN or photo hosting site and want to keep those images where they are.


A wonderful time saver

This plugin did a fantastic job for me. It allowed me to update the images on a site I was working on that had over 500 posts with images in most of the posts. The plugin imported the images from the previous blogger site into the media library and updated the images url. Thank you for taking up the task of maintaining this plugin.

Don’t typically leave reviews

Don’t usually leave reviews, but this plugin worked beyond marvelous. Been looking for something like this for a long time with no success– had a few imports not include uploads & this imported them perfectly. Updated the img src and hrefs w/o issue. Awesome plugin!

Works well

This plugin works well. I was able to import all the external images I needed for my blog posts. It did take me a few seconds to find the batch import function (it’s buried under the Media menu item) but once I found that it just took a few minutes for it to import the images and redirect my posts to the local ones. Excellent work. Thanks.


Just does not work

I have hundreds of posts. Whenever the page is refreshed per instructions, it just keeps going through the same posts (same problem as original plugin). No obvious errors, just does not work.

Read all 14 reviews

Contributors & Developers

“Import external attachments” is open source software. The following people have contributed to this plugin.




  • Adds support for pages.
  • Adds support for .doc and .docx files.
  • Fixes security issue by not directly echoing $_GET['post'] but casting it to int.
  • Adds support for filenames with spaces in them (by removing the space from the exclusion in the regex).
  • Makes the regexes slightly easier to read by making them case insensitive.


Add .jpeg support.


Remove duplicate README.


Fix some typos.


Add GitHub link.


Fix naming.


Make import_images_start_time a function. Hopefully it works now. :^)


Make import_images_start_time globally accessible.


General cleanup.


Merged upstream pull requests from bengreeley and IvanDoomer and changed to ‘Import external attachments’.
Now supports PDFs and HTTPS!


Fixed case sensitivity, thanks to
Fixed duplicate EXTERNAL_IMAGES_DIR notice


Fixed title in readme.