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'm currently writing a plugin modifying the post content with the wp_insert_post_data filter. While doing that I would also like to add a post thumbnail using an external image url. It doesn't really matter if the image is hotlinked or copied to my wordpress installation. Anyone knows how to go about that?

share|improve this question
up vote 1 down vote accepted

you should have a look to this blog post : http://www.maverick.it/tech/create-thumbnails-using-wordpress-built-in-functions

then, if you can't use a remote image, just download it as a temporary file on your server, process and delete it.

One your image created, you should then insert it as an attachment (http://codex.wordpress.org/Function_Reference/wp_insert_attachment) and set it as the post thumbnail (http://codex.wordpress.org/Function_Reference/set_post_thumbnail)

I hope it will help.


share|improve this answer

This may help?


It's a plugin that lets you set your featured image from an external image URL.

share|improve this answer

Hotlinkig is inherently evil.

Just host the images on your own server. Use WordPress built-in Media Management to attach the images to your posts, and to designate them as featured images (i.e. post thumbnails).

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.