Generate Post Thumbnails

UPDATE: Now supports externally hosted images.

UPDATE2: Externally hosted images generation was improved.

WordPress 2.9 introduced the new feature Post Thumbnails. This feature allows to assign post thumbnail at post Edit page for each post, specify post thumbnails sizes in theme settings, and easily call post thumbnail of specified size in any place of the theme. Read more information about this feature at Mark on WordPress – New in WordPress 2.9: Post Thumbnail Images

The plugin Generate Post Thumbnails helps to automatically create post thumbnails for existing posts using post images. This plugin by default takes the first image in the post content and assigns it as a post thumbnail according to specified settings in the theme.

Plugin management page

I found this helpful after I decided to use Post Thubmnails feature in existing WordPress blog. I upgraded my WordPress to 2.9 and altered my theme settings according to New in WordPress 2.9: Post Thumbnail Images. I had hundreds of posts already, so I needed an automated script to run through them and assign my first post image as a post thumbnail. This is when this plugin came in handy. It is working using Ajax requests, so there is no timeouts issues. For my 200 posts it has been executing for 4 minutes. Anyway, this is faster than to do this process manually.

Requirements:

Installation

  • Download plugin
  • Extract zip in the /wp-content/plugins/ directory.
  • Activate the plugin through the ‘Plugins’ menu in WordPress.
  • Open the plugin management page, which is located under Tools -> Generate Thumbnails. If you get plugin warning, that means either your theme does not support WordPress Post Thumbnails feature or your WordPress version is lower than 2.9. See related links for more information.
  • Set Overwrite parameter, if you want existing post thumbnails to be overwritten by generated thumbnails.
  • Set the number of the post image, that you want to be used as your post thumbnail.
  • Click on Generate Thumbnails and wait until process is finished.
  • After this plugin assign all post thumbnails I suggest to use Regenerate Thumbnails plugin if you changed your media settings or theme post thumbnails settings and need to regenerate new thumbnails.

More useful plugins:

  • Regenerate Thumbnails – recreates already existing post thumbnails after changing their settings; however, it does not assign them if the post has no thumbnails yet.
  • Auto Post Thumbnail – generates post thumbnail after post saving.
    • http://www.beautifulyoubyjulie.com Kate

      I probably worded that wrong, it doesn’t ‘refresh’ but you can see that it’s ‘thinking’ and then it just stops and nothing happens. And yes it’s the latest version, i just downloaded it yesterday. thanks.

    • http://www.beautifulyoubyjulie.com Kate

      bump**

    • admin

      Hi Kate, I am trying to reproduce this, but no success. The only time it does not work if Javascript is turned off. What browser are you using? Try Chrome or Mozilla Firefox.

    • Kate

      Hi thanks for trying, I have tried both Firefox and IE.
      I have also disabled all other plugins (and tried in both browsers with disabled) and it still isn’t working.

      Could it be something to do with Thesis theme? And/or where would I look to see if Javascript is turned off?? Thanks (again!)

    • admin

      Hi Kate, you should see a message from plugin if JavaScript is turned off. It turns on in browser settings. Thesis theme may be the reason if it creates additional layer for post images. I can’t tell this for sure as Thesis is not open source. What happens when you set post image manually in Featured Image block on Post Edit screen?

    • Stacy

      Hi great plugin!
      I’m using embedly for many post images now which it allows embedding by url alone , so how can I get thumnails generated?

    • admin

      Hi Stacy, the best approach for you is to use Custom Field option to provide URL to post thumbnail in a custom field after each post. Set this option as thumbnails source in plugin settings and provide the name of custom field. http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/#custom_field

    • http://www.gadgetszu.com Gadgets

      Please help me i don’t want to use my thumbnails when post is opened

    • admin

      HI Gadgets, you can use plugin tag to control display of your thumbnails in theme files.
      http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/#display

    • Hernan

      Hi Maria. Is there a problem if the name´s image contain spaces? I mean that: %20. ?

      Example: http://domain.com/the%20soccer%20game.jpg

      I tried to generate a thumb and the message was “Remote server does not return image…”

      How can I do?
      THANKS!!!
      (sory by my poor English).

      Hernan.

    • admin

      Hi Hernan, is this the problem only with images with spaces? I tested remote images with spaces and they worked.

    • Hernan

      Maria, thank you for your reply. The problem is only with images with spaces. You can see in http://salud.paginawebya.com.ar. Posts #1, #6 and #8 have images with spaces.
      I am using WordPress 3.1

      Thanks agin! from Argentina,
      Hernan.

    • admin

      Thank you Hernan for this information, I’ll try to fix that.

    • Hernan

      Tkank you! Good luck!

    • Enrique

      Hi, I can’t get the plugin to work. Using version 0.8. Javascript enabled, wordpress 3.0.1.
      When I click generate thumbnails, sometimes the page refreshes and no result, and sometimes the page doesn’t refresh, but no progress bar shows, nor live log updates.
      I will try to upgrade my wordpress, but if you have some clue please let me know.

      Plugin looks promising!!!

      Thanks, Enrique.

    • Enrique

      I’ve just updated wordpress and the plugin works now. Thanks!!

      Enrique

    • Enrique

      Well, just found another problem. It generates thumbnails only from images located in the wp-upload directory. All posts with images located in another directory of the same site are skipped.
      The images directory is located outside the wp installation, but on the same site.

      Thanks.

      Enrique

    • admin

      Hi Enrique, if your post has full URL to that image this should work. I just made a test, I added an image outside my wordpress directory, I created a post with that image with image src=”http://my_server/image” and run plugin and thumbnail and uploaded to wp directory was generated. This should behave the same way as an image stored externally.

    • Marc Steel

      Bless your soul.

    • http://www.angrybirdsxxx.com Angry Birds

      Hey where is the overwrite function?

    • admin

      Hi Angry Birds, I removed this feature at some point. I got complaints that it produced unexpected results for some people and ruined their website. External images can change, and if you overwrite, your existing thumbnail also changes.

      You can get previous versions here:
      http://wordpress.org/extend/plugins/generate-post-thumbnails/download/

    • James

      Is it possible to run this automatically with a cron job or something similar? I have some RSS feeds that get pulled in every hour and need this plugin to run just after the RSS feeds to generate the thumbnails for the feeds.

      Please let me know.

      Thanks
      James

    • Pingback: New Blog Framework – Custom ‘Trending Theme’ – Justin Tadlock()

    • admin

      James, you can’t to call any plugin function externally, like for cronjob. You need to rewrite plugin code for this.

    • Marc Steel

      Let me say thank you again. I’m migrating a blog with years of content and don’t want one giant folder with all the images so I tweaked the code a bit and early tests seem to show it’s working ok.

      I changed line 242, where it determines the upload directory, from using the current time to using the post’s time.

      So far so good!

      if ( ! ( ( $uploads = wp_upload_dir( get_the_time(‘Y-m-d H:i:s’, $post_id) ) ) && false === $uploads[‘error’] ) )

      Awesome plugin, awesome code.

      Cheers,

      Marc

    • http://www.wirelessandmobilenews.com/ Adam Bell

      I just tried your plugin on a site with almost 7,000 posts (http://www.wirelessandmobilenews.com/) and it supposedly generated post thumbnails for the featured image, did the whole progress bar which took over an hour to complete but no thumbnails were actually generated. Not all posts have pics, but most do. So why didn’t the thumbnails generate?

    • admin

      Hi Adam, what is in your log?

    • http://www.wirelessandmobilenews.com/ Adam Bell

      I’m not sure. I get a lot of this:

      [Fri Sep 09 05:00:55 2011] [error] [client 77.88.24.27] SoftException in Application.cpp:601: Directory “/home/xxxx/public_html” is writeable by group

      with ‘xxxx’ being the sites folder.

    • admin

      Hi Adam, this is log not from my plugin. You can see plugin log on plugin page.

    • http://www.wirelessandmobilenews.com/ Adam Bell

      Well, it’s really long so here’s a couple of things it says:

      Post: 22. No image found in the post…
      Post: 9002. Image from post body was successfully assigned as featured image…
      Post: 11352. External image was successfully uploaded and assigned as featured image…

    • admin

      Adam, I can assume that post with id 22 does not have image in post body, and the rest were assigned successfully?

    • http://kohsamui.co.uk Paul

      Hi Maria,

      I have downloaded your plugin related post thumbnails and activated it to my blog. No images appeared, so i downloaded your sugested plug, generate post thumbnails and activated, but it stopped working at 32%!

      My theme is Brunelleschi 1.3.5 by Kit MacAllister.

      My blog is kohsamui.co.uk

      im a bit of a newbe, not used thumbnails before!

      Would love to get your plugin to work as it will look great on my blog.

      Would be great if you could tell me what to do to get your plugin to work for me!

      Thank you Maria.

      Paul

    • admin

      Hi Paul, the log generated by plugin would help to see what’s the problem.

    • http://kohsamui.co.uk Paul

      Hi Mary, Was calling you Maria earlier! Sorry! its the person aboves fault!

      Thanks for getting back to me! I this evening noticed that once you click on a blog entry, you then see the thumbnail images, and they look very nice! Thank you!

      My videos are not showing though, not sure why, can I change something for them to show?

      Post: 127. No image found in the post…
      Post: 2211. No image found in the post…
      Post: 2213. No image found in the post…
      Post: 2208. No image found in the post…
      Post: 1531. Post has featured image already. Skipping…
      Post: 83. Post has featured image already. Skipping…
      Post: 191. Post has featured image already. Skipping…
      Post: 206. Post has featured image already. Skipping…
      Post: 284. Post has featured image already. Skipping…
      Post: 567. Post has featured image already. Skipping…
      Post: 629. Post has featured image already. Skipping…
      Post: 947. No image found in the post…
      Post: 1084. Post has featured image already. Skipping…
      Post: 1263. Post has featured image already. Skipping…
      Post: 1645. No image found in the post…
      Post: 1729. Post has featured image already. Skipping…
      Post: 1854. Post has featured image already. Skipping…
      Post: 1880. No image found in the post…
      Post: 1898. Post has featured image already. Skipping…

      Above is what the log is showing, I think its showing 19 published posts, I have a total of 26. Its still stopping at around 30%. Not sure if my images are all showing as thumbnails, as it stopped at 30%?

      Thanks for helping me sort this out, you must be very clever to be able to design your nice plugin!

      Thank You!

      Paul

    • http://kohsamui.co.uk Paul

      Just admiring your logo, which is very fashion, I like it! Also noticed your name IS Maria! Sorry again!

      Paul

    • admin

      Paul, plugin can’t translate images from videos, you need to set Featured Image manually like here: http://wordpress.shaldybina.com/wp-content/uploads/2010/05/featured-image.jpg

      Probably, that’s the problem…

    • http://kohsamui.co.uk Paul

      Hi Maria,

      Hope your fine and thank you for your reply.

      I have been trying to suss this out with the videos, seem to be getting closer, but not quite there yet!

      I use vipers video quicktags plugin to upload you tube videos to my blog.

      I finaly found a way of setting the video image manually as featured image, but the image is too small! Please see link :
      http://kohsamui.co.uk/?p=2463

      I am probably doing this wrong and maybe a long way round, but this is what i did: went to you tube tried to copy as the image of the video, couldnt, but could copy as on the first search of the video by google, then I clicked on videos, saw the video didnt go into it, just copied as there.I then saved the image to my pictures.

      I then clicked on set featured image>selected the file from computer> it would not let me select image as thumbnail, only full size. i finished and was left with the small image in the link above.
      I looked at the properties in the image, which says mulberry bmp.

      Please Please Please tell me what I am doing wrong Maria!

      Thank you!

      Paul

    • admin

      Hi Paul, I don’t know, I would probably take a screenshot of my video and make a featured image from it.

    • http://kohsamui.co.uk Paul

      Hi Maria,

      I will google how to do a screen shot, hopefully this will work. Many thanks for your help. Your plugin is amazing! Thank you!

      Kind regards,

      Paul x

    • Anuj

      Dear marry i am using this plugin but not able to get thumbnails on home page at my site please tell why i am not able to get my images. i am using default image after change according to my content. Please guide me . Our portal id is http://www.theindiapost.com

      Regards
      Anuj

    • admin

      Anuj, please check this http://wordpress.shaldybina.com/plugins/related-posts-thumbnails/#possible_problems If you are using plugin tag on your home page, make sure it appears inside the Loop.

    • Pingback: Here, we go, again. | 47 Hats()

    • Stephan B

      Hi there i just broght a site that uses this plugin http://www.sortedworldnews.com it all worked ok on the old owner but on my hostgator decated server the autom tumbs does not work any idae how i can fix this thanks for your time

    • http://notes.shaldybina.com/ Maria

      Stephan B, what do you see in error log when thumbnails are generated?

    • http://www.facebook.com/jrpianist Juan Ramon Martinez

      Hi Mary, I don’t see the ” Overwrite parameter” parameter on my panel. :S

    • http://notes.shaldybina.com/ Maria

      Juan, I removed overwrite parameter, because its behavior was unpredictable for some people.

    • http://www.facebook.com/jrpianist Juan Ramon Martinez

      Ohhhh great Maria! by the way thanks for this plugin, you saved me!!! xD set a featured image manually was very tedious, but now thanks to you, I don’t have to get boring doing that. :*

    • http://www.facebook.com/jrpianist Juan Ramon Martinez

      Mary, a little sugestion… would be great if you include an option that let us “generate thumbnails” or “remove featured images” of a specified category… or a specified month. it would be more easy to use, because if you have too many posts, that process would delay a entire day because you cant interrupt it.

    • http://notes.shaldybina.com/ Maria

      Juan, thanks for suggestion. I added to my todo this.

    • Honesty

      Hello, I’m using Version 0.7 of “Generate Post Thumbnails” and it’s now time for an update to Version 0.8.

      I’m currently using Word Press 3.3, if this plugin doesn’t work can you suggest another…