Regenerate Thumbnails

Hi there. May I suggest using Jetpack’s Photon module instead of this plugin? Photon will use WordPress.com’s servers to generate thumbnail images for you on-demand in whatever size is needed. This means that you don’t need to use my plugin to generate new thumbnail images when you switch themes, change thumbnail sizes, or anything else!

Don’t want to use Jetpack? That’s okay too. My plugin still works just fine.

Plugin Description:

Regenerate Thumbnails allows you to regenerate the thumbnails for all of your image attachments. This is very handy if you’ve changed any of your thumbnail dimensions (via Settings → Media) or switched to a new theme with different featured image sizes after previously uploading images.

Download:

Screenshots:

692 thoughts on “Regenerate Thumbnails

  1. Hello!
    If someone would like to upgrade your plugin automaticly it says that it couldnt be found .. coz the link is wrong (broken):
    Frissítés letöltése innét(“Downloading upgrade” in hungarian:): (http://downloads.wordpress.org/plugin/regenerate-thumbnails.2.0.2.zip).
    Sikertelen letöltés(“download failed in hungarian”). Not Found
    instead of
    http://downloads.wordpress.org/plugin/regenerate-thumbnails.zip
    ..You should create at least a symlink to it or use a name format that follows the change of versions..

  2. This plugin is great! I use the set_post_thumbnail_size() in functions.php to set the new size and then I run the plugin to regenerate all the thumbs. This safes me a lot of time and now I can quickly change thumbs in the future. Thank you very much!

  3. Hi !
    Thanks a lot for this plugin, which is really useful for thumbnails. But I’d like to use it for updating the large size of all the pictures of my blog.
    I expanded my blog theme, so I would like to show larger pictures than before (800px > 950 px). I changed the large size setting in WordPress, but I can’t see any change on the posts. So I guess I should run something like Regenerate Thumbnails, but for the large setting.
    Could you tell me if this plugin could be useful for what I need ? And if it is, how should I procede ?
    Thanks !
    Nicolas

    • That’s because the img tags in your posts have the width/height/image URL hard coded into them.

      I actually wrote some code just a couple of days ago that replaces img tags with the updated version (I changed the width of my theme and ran into the same issue) and I plan on including the code in this plugin in the future. I’m just too busy right now to do it. :(

  4. Looking forward to get more update on this plugin to include changes for all settings in image size.

    Also is there a recommendation of a plugin which can automatically generate post thumbnails for posts.

    Regards,
    Ashish

  5. Pingback: Tema Mystique: come rigenerare le miniature dei post

  6. Hey, I just ran this on my site and now all the photos in my galleries show up at full size rather than the thumbnails. Yikes! Check out http://www.motorcyclemojo.com/2010/03/riding-arizona/
    When I go into the image uploader and look at the photo information, all of the alternate image sizes (thumbnail, medium, large) are grayed out with only “Full size (0 x 0)” available. When I look at the directory on the server, the thumbnails are there. Somehow the link from the full size to the thumbnail have been removed. Any thoughts? Thanks.

  7. GD is installed and working well. I just tested, I can upload new images and they resize normally. Something I noticed, the original thumbnail files on the server aren’t being updated (ie: still the old file dates). So, somehow the attachment information was updated but the images weren’t updated. I’m not sure what to do at this point.

  8. Viper007Bond, don’t worry about it. I have realized that a SQL change I made earlier today has borked my site and Regenerate had nothing to do with it… it just brought the error front and center. I am restoring from a backup. Please feel free to delete my posts since they end up having nothing to do with your plugin, just a co-incidence. Thanks!

  9. Will your plugin follow my theme’s functions.php settings for additional thumbnail sizes (or does it only follow WordPress –> Settings –> Media). For instance, if I add the following to my functions.php, will your plugin create a thumbnail based on those settings.

    add_image_size( ‘other-thumbnail’, 200, 200, true ); // other thumbnail size

    Basically, I forgot to create a thumbnail size and already uploaded all the images. Please let me know if this will work. Thank you.

      • Hi, I’ve installed and run your plugin but the thumbnails of my blog are still the same size, i’ve tried several times, changing size in Media setting. Nothing was changed. I use the last updated versionb of wordpress and I have around 400 pictures.. is there something else I can try?

  10. I am trying to run this plugin but I just get an error message saying:

    Unable to find any images. Are you sure some exist?

    Any ideas why it’s not finding images? They are stored in my uploads dir..

    Thanks!

    • My plugin only resizes attachments, i.e. those that have been uploaded after… WordPress 2.5 I think it was. Before then, details about the uploaded file weren’t stored in the database.

  11. I installed the plugin on one WP site (out of 7 hosted together) which was having problems, all of the others were working fine and do not have your plugin. However now none of the 7 sites are showing thumbnails!?

    How on earth can that be? It seems a bit coincidental that this happened after istalling regen.thumb but I’m confused as all blogs are seperate WP installs with seperate databases?!$%

    Any ideas would be grateful!

  12. I get an 500 Internal Server Error.

    Source: action=regeneratethumbnail&id=32

    It works with action=regeneratethumbnail&id=31 and others.

    Maybe you need to catch those errors to continue the execution of the script.

  13. Pingback: Regenerate Thumbnails v2.0.0 « Viper007Bond.com

  14. First off, thanks for the plugin. I am migrating a very mature site and so the plugin is being asked to handle a lot. I am seeing the same issue as Ali. Stall out every time at 65%. Same sort of thing in firebug. If you have decided it’s a bug, is there a patch release forthcoming?

  15. FTR, the plugin is not compatible with newest jQuery version (1.4.2 at the moment of writing) I deregistered WP bundled jQuery and registered newest script. When regenerating thumbnails nothing happened…

  16. Pingback: Blog What I Made » Week Notes Week 93

  17. Hi Viper,

    Big fan of this plugin. Quick question. Is there a way of calling it (perhaps via functions.php and a hook) to automatically generate a thumbnail when a post is saved?

    Thanks again for this great plugin!

    • To regenerate all images attached to a post, but only when the post is saved? Such code could be written, but no, my plugin cannot do that as-is. There’s no pluggable function really.

  18. Pingback: Plugins de Wordpress usados no blog | Comunidade Pesbrasil

  19. Pingback: WordPress/CSS help

  20. Pingback: ??? ???????? ? ???? ????????? ???????? | ?????? ???????? ??????? Wordpress | n-wp.ru

  21. I have a wordpress install where it simply doesn’t works.
    When I click to regenerate thumbnails it goes to the other page but I get no loading bar and nothing happens.
    It’s WordPress 3.0 RC3 and PHP 5.2.3, GD is installed and working.
    I tried disabling all plugins but no success.

    I have another install of wp 3.0 RC3 with PHP 5.2.12 where it works without problems.

    I just don’t know why it’s not working.

  22. Know what would make this plugin really cook? Some instructions on how to run it.

    I installed it, activated it, then went through every friggin’ WordPress 3.0 menu in the dashboard and can’t see a single thing added that allows me to update the thumbnails. No buttons, no text, nuffin. Zip. Zilch. Nada. Bupkis.

    • I second that. I have no clue what to do after activating it. Maybe put the instructions on top of your page and/or in the text next to the plugin. HOW DO I MAKE IT START????

  23. I don’t have the function js_escape() in my system. RHEL 4, with PHP 5.1.6

    I had to remove this for the plugin to work.

    Once it worked, it ran like a dream. Any replacement solution for this?

  24. Just for you to know that I solved my problem by replacing js_escape() with esc_js(), as mentioned above.

    Now everything works like a charm!

    Thanks Jim Isaacs for pointing the problem.

  25. I’d love to see a feature added: a checkbox to generate only missing images… Right now I’m using it to update missing images, and chugging through ~2000 images is superslow just to update the 100 or so missing. That said, this plugin is a saviour!

  26. Hi, I discovered I had some problems with the plugin because I had WP DEBUG enabled on my wp-config.php and wordpress returns error messages for deprecated functions when the debuger is enabled.

    So replacing js_escape() with esc_js() solved the problem since it’s not using a deprecated function anymore.

    Disabling WP DEBUG would also work.

  27. wow ,you have so many nice plugins ,all of em are really so cool n simple to use.I had never thought that I could resize all of my images at one go and that too with so much ease.
    Thnx a lot for helping us for redesign our blog

  28. Hi there, ever since the word press 3.0 upgrade I cannot get this plugin to work for my Arras theme. It’s always worked perfectly, but now just freezes at 24%. And yes, I have upgraded to the latest version of the program.
    Any help would be appreciated!

    Thank you

    • If it’s freezing, then an image resize is likely failing which is preventing it from continuing. I need to take some time to tweak it so that it doesn’t completely break the whole process when a single image times out (too large of an image file or whatnot).

  29. Viper,
    Thanks for the response. I figured that might be the cause. Its a GREAT plugin, thank you for making it available. I am looking forward to that update. ;)

    Have a great weekend!

    Damian

  30. I ran the Regen and it appears to have broken most of my thumbs. They are simply gone when looking at Media-Library. 127 images. I changed the Thumb size and re-ran the plugin with the same result. Any ideas.

    • That’s weird. I’m using the built-in functionality. Do the new files exist in your uploads folder?

      BTW, to “undo” this, just change your media settings back to what they were before and re-run the plugin.

  31. I created a New post yesterday and uploaded an image from my hard drive and poof…no thumbnail. I go Media Gallery and the majority of the entries did not show a Thumb. I make adjustments to the size and re-ran the process with no success.

      • The other way the problem presents itself is….after running Regen Thumbs…when I look at Admin-Media-Library there are no Thumbs presented. Just the placeholder alongside the entry. If I choose to Edit an image followed by “Edit Image” I am presented with the actual image but there is nothing in the Current Thumbnail box. I feel like this plugin nuked my Thumbs completely out of existence. (It appears that only 10% of my thumbs survived this process.)

  32. Hello there,
    I was trying to use your plugin, but it always stops completely at some point (sometimes 24%, others 72%, etc). Is there something I could do to find out which image is the problem?

    • I didn’t try but in the regenerate-thumbnails.php file there’s a javascript function called RegenThumb that take the id of the image to resize as input; if you print it, since the function is called for each image you will know the latest working image; if you also print the $ids array you will have the list of all the images ids so the id in the list after the last working one should correspond to your broken image. It’s just a guess, good luck.

  33. Hi Viper,

    I was using your awesome plugin and in theory it should be working like a charm, but in my case it says that all the thumbs are generated successfully but in fact, it didn’t do a thing!

    I was going from 150×150 to 300X168; All the essential php modules are loaded; permissions are OK;

    I tried all sorts of test cases, but if the plugin returns a success it’s so hard to know where to start looking! Ajax requests are returning ‘-1′.

    Any Advice? Thanks in advance!

    Arjen, The Netherlands

  34. Hello Viper,

    I have been referred to you by SoZo, a senior moderator at StudioPress.

    I will be adding a few new image sizes to the functions.php file of my StudioPress theme which runs under their Genesis framework.

    My question is .. If I:

    1 – add the new sizes to the php file (2 new sizes + the original size, so 3 in total)
    Original thumbnail size is 150 x 150 – new ones will be 100 x 100 and 70 x 70
    2 – run Regenerate

    Will it generate the 2 new sizes and leave the original intact?

    Thanks and cheers,

    Gil

  35. Oke i found out that it has to do with the filepath in the database

    some entries look like this

    /home/.deceleration/arkl/mywebsite.com/wp-content/uploads/2009/06/an_Image.jpg

    and some like this

    2010/08/an_Image.jpg

    so in both cases the plugin thinks these files do not exist!

  36. Hi,

    The plugin appears to work, but am I correct in saying that if I want to resize images which are already inserted into posts I have to re-insert them after running the plugin? Or should this (i.e. amending the dimensions in the actual html tags) be happening automatically ?

    Thanks.

    • Sadly yes. The width and heights are hard-coded into the HTML in the post.

      I have a newer version of this plugin sitting on my computer that actually goes through all posts and fixes this, but I’m not quite happy with the code in it’s current state and I want to rework it some more before I release it. Unfortunately I’ve had little free time lately.

  37. Pingback: Regenerate Thumbnails Plugin - Creativille

  38. Hi-
    I have tried to run Regenerate Thumbnails (awesome pluging, btw, and many thanks!) but it keeps getting hung up at 4%. I ran Firebug but it’s not detecting anything.
    I let the plugin run overnight and the next morning, it was still at 4%. I have 175 posts and about 300+ images.
    Any idea what I can do?
    Many thanks,
    C

  39. I third Jan-Mark’s comment. I read this thread solely to find out what to do after activating the plugin. It’s not enough to have a mention on wordpress’ plugin download site, because as of wordpress v3, you install plugins internally and don’t visit that site. Further, I was instructed to install it by another plugin, so I really had no other interaction with that page.

  40. Great! :D You are a life saver. Actually I was developing this plugin -> http://wordpress.org/extend/plugins/wp-category-posts-list/ and really needed something to regenerate the thumbnails as it registers different post thumbnail sizes as per the user input. If the user changes their thumb size, then it will register another thumb size using add_image_size which would cause HTML resizing of the featured images of previous posts! It was really a headache for me, as then using timthumb seemed the only solution! But on the other hand I really wanted to use the new featured image feature of WP :) . You have really given me a solution… All I need to do is ask the user to run your plugin once after changing/setting the post thumbnail size…. Hats off to you :)

  41. I seriously don’t know whats going wrong with WP Plugin directory :( It is not showing tabs, maybe not pursing the readme.txt file properly! I had seen this for some other plugins as well!

    @Dave Carr, Buddy you should try installing it from your admin>plugin>add new and search for the keyword thumbnail. You should find it there!

    I hope WP solves their issue soon… @Alex do you have any idea why is this happening??

  42. Hey.

    I search the plugin too . . . . What the hell is going on ?
    Does somebody have the plugin and can re-upload it on another platform ? Like his FTP ? Thanks ! Really.

  43. Pingback: WP Category Post List Plugin – List your posts filtered by categories with thumbnails | InTechgrity

  44. Pingback: Regenerate Thumbnail size for attachment images wordpress | InTechgrity

  45. Pingback: Tema Mystique: come rigenerare le miniature dei post

  46. All thumbnails and custom thumbnail sizes were working just fine until today when i ran the regenerate thumbnails plugin, and my custom thumbnail sizes are no longer working. It seems that the plugin has changed it so that all custom sizes now simply load the regular size instead of the custom one. In Safari’s activity window it used to show the correct thumbnail files loading, but after running the plugin all thumbnails load the original image file instead. What could be causing this?

    • My plugin hasn’t changed and it doesn’t do the resizing itself or anything, it just tells WordPress to do it. It’s merely two function calls on one line in my plugin.

      So if something isn’t working, then it’s an issue with WordPress or more likely with how you are registering your custom image sizes.

  47. I ran this today after changing my media settings to a slightly smaller size. Now that I look at my site, all of the images posted are still the old larger size… did I do something wrong? Is there another step to get my blog to realize that all of the old images should now be smaller?

    • This plugin only affects images in [gallery] and post thumbnails for the time being as manually inserted single images have been hard-coded into your posts (edit the post and you’ll see what I mean).

      I’ve been experimenting with some code that goes through your posts and updates all <img> tags, but it’s not quite ready for release yet.

  48. when I’m trying to regenerate thumbnail… I didn’t even closing page, but it stops. sometimes on 4% process, sometimes 37%, once it was 85%… but never 100% =(
    WP version. 3.1,

    ps. And where all that thumbnails stored? I mean as pictures on server, and as information in db?

  49. Pingback: ayuda con los thumbnails de este theme

  50. Pingback: Alter Free Branford Magazine theme to use Wordpress Thumbnail instead of timthumbs | Dx3webs | UK Magento e-commerce hosting

  51. Hi Alex,

    I’m currently switching my own theme to WP 3.x compatibility and have enabled support for several different sized post thumbnails (featured images). I need to regenerate all older images to the new defined images sizes and would really love to use your plugin for this. However, the plugin always stalls after only 1%. Presumably a resize is failing like you already mentioned to nstaru, but I can’t figure out which image breaks the plugin.

    We currently have little over 2000 images (Media | Library) and I’d hate to start all over again if the plugin suddenly stalls or bails at image 1600 (like I think it currently does).

    Does a solid donation help in giving the plugin some TLC, providing better error reporting and hopefully picking off without regenerating all over again? Or do you know of any other way to process 2000 images automatically with all the needed sizes?

    • You can easily see which image it is failing on using Firebug or some other tool that shows you AJAX requests. The image ID will be in the URL.

      The solution is probably to increase the amount of memory allocated to PHP. Large images take quite a bit of memory to resize.

      • Thanks. Will check with Safari’s console.

        PHP’s memory allocation is already at 256MB (dedicated server), so I don’t think that’s the issue. It’s probably stumbling on a missing or broken image, I just need to find out which one, but hopefully the console will offer some insights.

  52. Sorry for the avalanche of comments, but FireFox with Firebug is more helpful than Safari’s console. I keep getting 500 Internal Server Error for random images, e.g. ID 32 which was perfectly processed the previous time I ran Regenerate Thumbnails. What other settings do you recommend to look at? Does it help to run Regenerate Thumbnails from the command line or doesn’t that solve anything? (if it works at all). I’d rather see a ‘Skip errors and continue’ setting and log troublesome images to a file or anything so I can fix these manually.

    As asked in my previous comment, is there another way to process 2000+ images automatically with all the needed sizes?

    • If you’re getting a 500 error, then that’s something with your server, not my plugin. No idea what could be causing it.

      And no, there’s no other way to force a resize. That’s the whole reason I wrote my plugin — because there wasn’t a way to call the needed resize functions. ;)

  53. This plugin just saved my life (a few hours of it that’s for sure). A much needed functionality which I wish was included in the default build.

  54. Hi Alex,

    Just about to use the plugin and thought I’d ask before running the batch… I have about 11K images to automate and regenerate the respective thumbs to for a large live website, and I’d like to know if in your opinion I may risk to get the system stuck while running this through. This must be a one-off only process and I cannot clearly risk to either get the system down due to script overload or loosing any of the images… any recommendation would be much appreciated.

    Lastly, as feedback, wouldn’t it be good to allow selection of timestamp of thumbs regeneration? For instance allowing the possibility to regenerate thumbs by period, day, month, year… just a hint.

    Thanks

    • Yes, this plugin needs further refinement and more options. It’s on my long, long todo list. :)

      As for overloading your server, that’s a possibility. It only does one image at a time, but it tries to do each of those images as fast as it can. I’d recommend doing it at night but even then it’s likely going to take a long time. It could cause problems, it depends on your server configuration.

  55. I gave your plugin a try because I wanted to Alter the size of thumbnails in a WP 3.0.1 site.

    I tried change the media options for thumbnails to 100×100 and saw that had no affect. So, I installed your plugin and clicked “regenerate” It says it completed 100%, but appears to have done nothing to the website’s images as all the images are still 150×150 despite the new settings in media.

    Does this plugin have any logging?

  56. Hey, thanks for the great plugin. It is something that I think should be added to the core and done when you change the settings in Media.

    Anyway, I’m keen to find out about the update to change the hard-coded HTML in the posts. I don’t really want to do it manually on all my websites but I guess for now I can.

    Thanks a lot man. No pressure at all if the update is not ready. :)

  57. Pingback: My recommended WordPress plugins « Enemy – Coax's Music And Stuff

  58. Pingback: Regenerate Thumbnails v2.1.0 (and v2.1.1) Released « Viper007Bond.com

  59. Yeah, there are many difficulties for dummies like me :)

    With this Plugin its really easier to change and edit the Thumbnails without open an extra programm :)

  60. Pingback: WordPress Plugin Releases for 11/24 « Weblog Tools Collection

  61. This plugin works fine to regenerate individual thumbnails in the media library, however, when I select multiple images and click on the Bulk Actions drop down menu, there’s no option to Regenerate Image as shown in your example.

    This is on WP 3.0.1. I tried deactivating/reinstalling and still can’t get that option.

    I debated whether I should try regenerating all my images but I have over 10,000 and I have a feeling that would be a bad idea. Thanks!

  62. I’ve installed the plugin but it appears to stop 0% for any image I try to regenerate. This happens with individual images as well as when I try to do them all in one go.

    Any ideas what may be causing it?

    Matt.

  63. Ahhh I never knew you could do that with Firebug, here is the message:


    Warning: set_time_limit() has been disabled for security reasons in /home/fhlinux010/p/website.com/user/htdocs/wp/wp-content/plugins/regenerate-thumbnails/regenerate-thumbnails.php on line 342
    {“success”:”"IMG_9126" (ID 304) was successfully resized in 6.885 seconds.”}”

    Hmmm that’s strange, just tried a few now and the bar seems to go to 100% instead of just sticking at 0. Still, it is saying that the regeneration has failed.

    • Your host has disabled my plugin allowing PHP scripts to run for longer than normal amounts of time (image regeneration can take a while, so I play it safe). As a result, an error message is thrown when I try to use that function and that makes the Javascript not be able to understand the result of the AJAX which it interprets as a failure.

      I’ll update my plugin to silence the error message. :)

  64. Ahhh okay thanks :)

    Might this be the same issue that is causing some images to stay at 0%? I know if I try to update all in one go it stays at 0% the whole time.

  65. Pingback: Worries with Wordpress: Image Resampling | Meeque.de

  66. Hi there,

    Users with Editor role get the following error when trying to regenerate individual thumbnails from within Media Library.

    I’m using WordPress Version 3.0.3 and version 2.1.3 of your plugin and the same method works perfectly for an admin user.

    Any ideas?

  67. Hello, if you want the plugin to also add the thumbs as featured images just insert this line

    update_post_meta($image->post_parent, '_thumbnail_id', $image->ID);

    after

    wp_update_attachment_metadata( $image->ID, $metadata );

    I haven’t tested it much, but seems to work ok.

  68. Pingback: ???????WordPress???? | ????

  69. Alex,

    Great plugin, very useful for all of these featured image themes we are seeing these days. We have run into an issue on a site that we just migrated to a new server. On the old server, the plugin works great, on the new server, the progress bar hangs at 0%. I tried manually uploading the thumbnails from the old server and then running the plugin, still hangs at 0%. I also tried running the plugin from the media page on an individual file, with the thumbnails from the old server in place, this works and the thumbnail appears correctly in the layout. We are running Regen. Thumbnails 2.1.3 and WordPress 3.0.4 with Multi-Site enabled. Here are the error codes we are seeing:

    Firebug Ajax Error:
    response is null
    [Break On This Error] if ( response.success ) {

    Server Side PHP Error:
    [error] [client 108.73.136.50] PHP Fatal error: Call to undefined method Services_JSON::encodeUnsafe() in /var/www/html/wordpress/wp-includes/compat.php on line 136, referer: http://accesslocal.tv/wp-admin/tools.php?page=regenerate-thumbnails

    We have installed the GD Library on the server side. Any ideas on what to try next would be greatly appreciated. Thanks!

  70. Pingback: 70 Plugins Wordpress – Belles à bloguer | Hello, Architekt !

  71. Thanks for the great plugin! I am trying to integrate it into the WordPress post/page edit screens in the admin so that users can regenerate a thumbnail after they edit it. Do you (or anyone) have any suggestions about the best way to do that? Thanks very much.

Leave a Reply