Regenerate Thumbnails

Plugin Description:

Regenerate Thumbnails allows you to regenerate all thumbnail sizes for one or more images that have been uploaded to your Media Library.

This is useful for situations such as:

  • A new thumbnail size has been added and you want past uploads to have a thumbnail in that size.
  • You’ve changed the dimensions of an existing thumbnail size, for example via Settings ? Media.
  • You’ve switched to a new WordPress theme that uses featured images of a different size.

Download:

Screenshots:

823 thoughts on “Regenerate Thumbnails

  1. Pingback: Regenerate Thumbnails - plugin per Wordpress - Attic22

  2. I have a very weird situation going on with my blog, image wise.

    I just recently changed the domain name and updated everything per wordpress codex. Anyways, all images I upload after the name switch shows the [gallery] fine, but all the old post wit the [gallery] prior to the name switch is showing the full size image instead of thumbnails.

    The thumbnail image does exist on the server and it even shows in the db.

    Would this plugin of yours re-link it or whatever if I just use the same dimensions? Technically shouldn’t it just overwrite the existing files?

  3. My plugin uses built in WordPress functions to handle everything. All it does is force a thumbnail/meta rebuild, as if you just uploaded the image.

    No idea if it’d fix your issue or not. Can’t hurt, but I can’t remember if it’ll skip existing thumbnails or not.

  4. Viper007Bond on April 2nd, 2009 at 11:00 PM wrote:

    My plugin uses built in WordPress functions to handle everything. All it does is force a thumbnail/meta rebuild, as if you just uploaded the image.

    No idea if it’d fix your issue or not. Can’t hurt, but I can’t remember if it’ll skip existing thumbnails or not.

    Cool, I guess my next question will be… will it regenerate in the same date/folder structure?

    Let’s say i’m recreating for a post in 2008/09. Will it create the thumb in wp-content/uploads/2008/09/image-115×115.jpg?

  5. Pingback: WordPress Regenerate Thumbnail Plugin | Bookmarks

  6. Just discovered where in 2.8 the regenerate thumbnails plugin appears “Tools > Regenerate Thumbnails”. Which is great, but I’ve just done an upgrade of a wordpress website from 2.5 to 2.8 and the plugin doesn’t recognise any of the existing attachments. So it doesn’t regenerate anything. Any help would be greatly appreciated.

    Benji

  7. @Benji, WordPress 2.5 didn’t use the same attachment method. The images were imbeded not attached.
    Solution= none automatic, manual attach, re upload.

    unless someone has created an amazing fix my attachments script.

  8. twincascos on July 2nd, 2009 at 12:21 AM wrote:

    @Benji, WordPress 2.5 didn’t use the same attachment method. The images were imbeded not attached.
    Solution= none automatic, manual attach, re upload.

    unless someone has created an amazing fix my attachments script.

    Thanks for that. It turns out that the main difference between 2.5 and 2.7 or later is in the metadata table of the each attachment the URL is absolute as opposed to being relative to the root of the uploads directory. So I managed to fix it by finding and replacing all the absolute paths in the metadata table and then run Regenerate Thumbnails. Now they’re all reprocessed and in the right sizes. Few! Awesomeness ensues. Thanks heaps though.

  9. That’s great, I was thinking pre 2.5, don’t you love change…
    maybe regenerate thumbs plugin could check if the metadata is absolute or relative, and offer to change/ upgrade the entries…

  10. I’m using godaddy as my webhost and they must be putting some kind of time limit on scripts because I only get slightly past the first image and it stops. I tried copying Cedric’s Quick n Dirty patch, but it didn’t seem to work, something must have changed in 1.1 that caused the patch not to work, or at least not as-is. If anybody knows of a way to make that patch work, it would be greatly appreciated.

  11. Also, I’ve got a script that will update your old 2.5 gallery items to the new type paths, but not in plugin form. I don’t really have time to make it into a plugin, but if there’s a plugin author that wants it, let me know, maybe it will save somebody some work.

  12. Josh on July 14th, 2009 at 8:12 PM wrote:

    Also, I’ve got a script that will update your old 2.5 gallery items to the new type paths, but not in plugin form. I don’t really have time to make it into a plugin, but if there’s a plugin author that wants it, let me know, maybe it will save somebody some work.

    Oh, I would LOVE that script is you make it publicly available.

  13. After running this plugin, you’ll need to change the values in the database too.

    This script will change the thumbnail sizes. PLEASE MAKE SURE YOU MAKE A BACKUP OF wp_postmeta FIRST.


    UPDATE wp_postmeta
    SET meta_value=replace(replace(meta_value,'150x150','145x110'),'s:5:"width";s:3:"150";s:6:"height";s:3:"150"','s:5:"width";s:3:"145";s:6:"height";s:3:"110"')
    WHERE (meta_key="_wp_attachment_metadata") AND (instr(meta_value,'150x150')>0)

    Replace 145 with the width you require, and 110 with the height in both places.
    Replace the 150 values with whatever your original thumbnail sizes were.

    (tested on version 2.8.3)

  14. The first time I used this plugin it worked great. I first edited media.php to crop my thumbnails from the top and the left. Then I ran the plugin.

    After that, I added some posts and noticed that the thumbs were being cropped from the center (possibly due to Thumbnails for Excerpts plugin I now suspect.)

    So, I ran Regenerate Thumbnails again, and the script timed out. Don’t know why since Yahoo says that it allows PHP scripts to run for 100 seconds. It quit after maybe 20. On top of that, the change I made to media.php was gone somehow and I don’t know what happened but,

    I have about 1/4 of my thumbnails are showing up up correctly (cropped from the top and the left) and the rest are cropped from the center.

    I don’t know how to get the patch listed above. I pasted it into the plugin PHP file right above the one (I think) existing reference to flush. I saved and got a fatal error from WP. I deleted what I pasted in and it’s back to the original state.

    Still times out after about 20 seconds and I have the same 1/4 of my thumbs showing up OK and the rest cropped from the center. Tried running from Safari and Firefox (Mac). Would using Windows help or is this a server-only thing? I didn’t think there was a problem.. It ran fine the first time. Should I contact my host (Yahoo?)

    Does anyone know if there is going to be an updated release of this plugin available?

    Thanks!

  15. Pingback: ???????????????? » Blog Archive » ?? WordPress ? Gallery ??

  16. Pingback: res4WP | WordPress Plugins: Viper007Bond.com: Regenerate Thumbnails plugin

  17. Pingback: Plugins WordPress 01-11-2009

  18. For me the plugin never makes it past 45% or so. I’ve left it alone all day several times and it never gets past there. I really need my thumbnails regenerated.
    Suggestions?

  19. Katie on November 4th, 2009 at 6:41 PM wrote:

    For me the plugin never makes it past 45% or so. I’ve left it alone all day several times and it never gets past there. I really need my thumbnails regenerated.
    Suggestions?

    What’s your webhost? My guess would be that your host is stopping it if you’re on shared hosting. I could be wrong though. The recent updates make it much more shared-hosting friendly.

  20. Pingback: at.yamomzcrib.com » Blog Archive » wordpress shortcode: smarterImage.

  21. Great plugin, but does it also resize the medium sized images or only thumbnails?

    ps. Love all the javascript effect on your site


  22. Josh:

    Josh on November 16th, 2009 at 6:54 AM wrote:


    Lisa:

    Great plugin, but does it also resize the medium sized images or only thumbnails?

    Yes. It uses the settings you set to change all the images to those sizes.

    Are you sure? For me it did not change the medium or large sized images. I tried it on a small blog with 100+ images before testing it on a big (5000+) images blog and it did not resize the medium files.

  23. Please forget my last comment! This plugin works like a charm and does also resize the medium images, it just doen’t crop them.

    Thank you!


  24. Lisa:

    Please forget my last comment! This plugin works like a charm and does also resize the medium images, it just doen’t crop them.
    Thank you!

    That’s because of WordPress. The plugin uses a wordpress API and wordpress doesn’t crop them when you first upload them, so the plugin won’t.

  25. My plugin pretends that you just uploaded them. It goes off the settings at Settings -> Media. If you tick the “crop” box for the small images, then it’ll crop them. There’s no option to crop the larger images.

  26. I used the plugin it says it regenerated 560 images.

    When I check the folders in ftp, nothing has been changed. used this with thumbnails for excerpts but to no avail

  27. Would love to see this feature on the individual media page. Like if I just wanted to resize one photo, because WordPress didn’t crunch one photo in a particular upload..

    Just an idea..

    Thanks for the great plugin!

  28. Pingback: Wordpress : Regenerate Thumbnails, pour redimensionner vos images | Weedle

  29. Sorry, the above comment is in response to the following ( i thought the reply would go under the original comment)

    Thank you for this great Plugin.
    What I am desperatly searching for is a plugin that compresses the base image as well, because some of our blog writers don’t compress their images before uploading. Maybe this could be added to?

    Jörn: that feature won’t be making it into this plugin as that’s not really the purpose of it (it’s just meant for thumbnails), although it wouldn’t be hard to write a plugin that compressed all images as there were uploaded.

    • I use flat threaded comments here. Note the “In Reply To Viper007Bond” at the top of your previous comment and how it’s a link to the comment you were replying to. 🙂

      Anyway, to answer your question, no the original file is stored and then additional files are created at the resolutions you specify at Settings -> Media. The original file is untouched.

  30. Really nice plugin. I tried it out and it worked marvelous.

    One thing though. Is it possible to edit the plugin so that it removes the old thumbnails?

    Otherwise aftera few regenerations you´ll stand there with 4-unlimited different types of thumbnails, and while each of them is small in size the sheer number of them together will take up space sooner or later.

    So if you could make the plugin delete the old thumbnails as it creates the new ones this plugin would be 100% awesome!!

  31. Pingback: WordPress Mediathek, Bildgrößen und Thumbnails verstehen und nutzen - TeraBlog (Brandt Aktuell)

  32. This plugin has saved me so much time, thanks very much. I was wondering – would it be possible to add a setting to control the quality of the jpg compression used when resizing images? It usually does a good job, but in some cases is compressing images more than I would like. I don’t know if there is any way to edit this setting in the plugin code or in WordPress.

    • There’s a core WordPress filter. Add this to your theme’s functions.php file or a new plugin:

      add_filter( 'jpeg_quality', 'matthew_hollet_jpeg_quality', 10, 2 );
      
      function matthew_hollet_jpeg_quality( $jpeg_quality, $function ) {
      	return 95; // Default is 90
      }
  33. Here is a quick question. I am considering renaming a bunch of uploaded images for SEO purposes, and to do this I am using the wordpress organizer plugin.

    On my testing server, I deleted all thumbnails, renamed a single file using the organizer, and regenerated the thumbnails. From what I can tell, all thumbnails have been regenerated, except for the file I renamed.

    My question is this: can you shed some light on how this plugin determines the files to create thumbnails for?

    …Mike

    • Information about uploads (type, resolution, what post it’s attached to, etc.) is stored in the database (I pull the list of image attachments from there, not your uploads folder). You cannot change the filename of an upload unless you also change the filename in the database, otherwise you will break things.

  34. Thanks. I managed to hack the abandoned wordpress organizer plugin to update the database with the new file name after renaming it on disk. It looks like I did it correctly, as your plugin is now Doing The Right Thing.

    Thanks again 🙂

  35. Hey Mike any chance you could share your adjustments to the organizer plugin?
    Maybe Viper007Bond will incorporate the organizer plugin into regenerate thumbnails.

    I have a project with embedded images which are not attached (pre WP 2.5)
    Anyone knows of a tool to turn the files into attachments?

  36. Pingback: ????? » ?? WordPress ? Gallery ??

Comments are closed.