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) after previously uploading images.
Download:
- Download from WordPress.org (704,175 downloads)
Screenshots:
- The plugin at work regenerating thumbnails
- You can resize single images by hovering over their row in the Media Library
- You can resize specific multiples images using the checkboxes and the “Bulk Actions” dropdown (WordPress 3.1+ only)



What about ERROR::”function (){if(!d){var c=arguments,g,h,i,j,k;b&&(k=b,b=0);for(g=0,h=c.length;g” ??
How can I fix it?
From my experience that means that the AJAX is returning an invalid response (invalid JSON). I think it’s a bug in jQuery.
I’m not sure how to fix it.
If you know how to use Firebug or Chrome’s developer tools, inspect the AJAX response and see what you’re getting back.
Hi,
I really love your plug-in but since WP 3.3.1 release, it isn’t working any more (same for 3.3.2).
What do you mean by “it isn’t working any more”? In what way?
Hi alex. it’s not working on our wp site, we’re using 3.2 Please help. thanks
It’s not working on our site. we’re using 3.2WP ver.
please help. Thanks
Hi Mel,
As I mentioned previously, you’re going to have to be a lot more descriptive than “not working on our site”. That’s like asking a car mechanic to diagnose your broken car over the telephone and the only information you’ll tell them is “it’s not working”.
lol it’s even bloody worse
Let’s see if I can explain this, the plug-in resized my thumbnails so when I am viewing them on the back end in the gallery they look right, but when I publish my site they have not changed. Any thoughts?
My plugin doesn’t go through your posts and edit them to reference the new sizes, not yet at least. If you have hard-coded references to images in your post, you’ll need to manually update those.
Gallery thumbnails, attachment pages, post thumbnails, etc. will automatically be updated though.
Thanks for a great plug-in. I’ve used it quite successfully previously but I’m wondering if there could be a possible enhancement where it could be selective on which image size gets re-generated. In my case I’ve added a new thumbnail image size of 80×80 used for post navigation. It seems it would be helpful if I could just re-gen all the thumbs for that new image size vs. re-gen all thumb sizes (site has a lot of images and several custom sizes).
I don’t believe the WordPress API supports this. I’d need to reinvent the wheel or do some hacky stuff.
Maybe in the future though.
Actually, Alex, I think WP does that – provided that toyNN registers that size. I ran into a similar problem where I have to regenerate a thousands of image thumbnails – for the post_thumbnail function
I’m 99.99% sure that it’s an all or nothing thing.
Hi, great plugin, however it’s not quite working for me.
I’ve used the plugin and it’s created new resized thumbnails for all my images but for some reason it isn’t replacing the actual images on the website. What I mean is that although it’s created the new thumbnails it’s not replacing the images on the pages of my site.
Any ideas? I’m using wordpress version 3.3.2
The URLs to your thumbnails are likely hard-coded into your content. My plugin doesn’t (yet) go through all of your posts and edit the HTML for them. You’ll need to do that yourself.
Hi Alex,
I have a website (denimhunters.com) that I’ve been running for a couple years now and over time I’ve changed the “attached display settings” for my images from 628px width to 640px. Do you know of any plugin that can change the display size of the pictures that are displaying at 628px? I have run all my +8,000 pictures through your great plugin, but as Cian I thought this would do the job and change the displayed image size. But sadly it doesn’t. So once again, my question is if you know about a plugin that will do this job – if it’s even possible to make such a plugin? I have around 5,000 images that need to be changed so doing it manually is simply not an option.
Thanks for you help.
The issue is the thumbnail URLs (complete with thumbnail size) are directly contained within your post’s contents.
I worked on some code for this plugin that would loop though all posts, updating all thumbnail URLs to reflect the latest thumbnail sizes, but it was kinda buggy. I should probably revisit that though.
Hi Alex,
Great plugin, we’ve used this across loads of sites at work. I’ve hit a slight issue however. We have a multisite setup with all sites using the same theme.
We released version 1 6 months ago and now we’re starting to improve it. Slight snag in that all of the images were defined and now we’d need to regenerate them in order to change the appearance.
Any experience with this plugin on a multisite setup and would it be possible to trigger the regeneration process on demand for all sites?
Any feedback would be great.
Just wanted to say thanks! You saved me hours of manually re-uploading images on my client’s blog. Excellent work here.
Hi, does the plugg in work with images in the Galleries and how?
Yes, it works with any image that is dynamically generated by WordPress, including those in galleries.
Hi, just used your plugin and it stretched all my “featured images” for my blog… they didn’t used to look like this until I used the plugin…what am I doing wrong? how can I change this?
see link for samples
http://www.dsgphoto.com/category/blog/
Looks like you fixed it. Things look fine to me.
Not sure why but the plugin stops on my WP 3.4.1 installation when regenerating thumbnails at 7.9% with the JAVASCRIPT error : TypeError: ‘null’ is not an object (evaluating ‘response.success’) on line 266 of tools.php. Any advice?
It seems to be something on this installation of WP. None of the thumbnails are generating in 3.4.1 for me. I even reinstalled WordPress. Nothing. Can i give you a login to the server to have a look?
Nevermind again, it seems to be a conflict with another plugin. Don’t have time to figure out which one right now either.
Realy nice plugin that work like a sharm just one sugestion it would be nice to have a option to add a default thumb if no thumb is present as FB integration needs a Thumb and many post generated sometimes from other sources like twitter ect .
This plugin is meant for regenerating thumbnail images. Setting a default post image would be the job of a different plugin.
Great plugin, indeed! I tried it allready and successfull at the first time. No error, neither problem… All my images where regenerated during preparing a coffee. I see it will be good now to connect this plugin with BuddyPress.
Awesome. Just had a problem w thumbnails, and then I remembered this plug in (from another site I have). So I installed, and it worked like magic (on my photography website). Absolutely great. Love it, and thank you.
I just wanted to say Thank you very much for your time and effort in creating this plugin. For a long time I wanted to move away from TimThumb and use the regular post thumbnail functionality in WP but was never happy with the way images were turning out. Then a friend of mine suggested your plugin. AWESOME!!! now I recommend it to anyone and everyone. Again thank you very much. Keep up the good work.
Thank you so much for this, it’s awesome!
hi Alex, is there a way to also generate custom size thumbnail that are defined in the functions.php theme file ?
thanks
Yep, the plugin already does this.
Actually, it didn’t work on my test site, but the functions.php calls another file (require etc;.) where the thumbs are defined. Should that be a problem…thx
It shouldn’t matter where it’s defined as long as it’s defined properly.
Hi Alex, I was use your nice plugin, and images was regenerate and the plugin work great. But after regeneration, the images on posts with “full” and “large” size dimension is verry small (50h50). I dont know whats happened ? Please help. The dimension i sets in option is 300×300
Alex, is there anyway to adjust permissions for the different user roles? For example, only administrators have access to plugins on my WordPress site, but I’d like to enable editors to regenerate thumbnails after they upload and post.
Thanks in advance, and great plugin!
You’d have to edit the plugin and change the
manage_optionscapability to something else: http://codex.wordpress.org/Roles_and_Capabilities#Capability_vs._Role_TableThank you! You really made my day
Alex, your plugin resize thumbnail images so you do not cut a piece?
regenero when the thumbnails in my posts the pictures appears cut highlighted.
Alex —
Great plugin! Wondering if you know of a method to run this via the command line or a shell script? Have a site that we need to process this on to remove unnecessary images from the uploads for storage reasons.
There’s currently 6500+ images and it’s just a very slow process to leave in the browser.
No but I should probably write a command for wp-cli and include it in the plugin.
Does Regenrate Thumbnails “remove unnecessary images” then? I thought it would not.
Good catch (overlooked that part of his comment). No, it does not, however Matt could manually remove all thumbnail images and then run my plugin to generate only the sizes that are currently registered.
Hi Alex. Great plugin.
However, I am having some issues. My home page posts use dynamic function calls for thumbnails:
the_post_thumbnail(‘small-square’, array(‘class’ => ‘wpp-thumbnail wp-post-image’));
However, when I run the plugin in my media library, it gives a message that 10 images have been processed successfully. I don’t see any indication of specific image sizes being generated, and on my home page, you can see that the original image is sourced in the img tag for the recent posts, for example.
This is true for the entire site. I attempted to fix this using CSS hacks, and it’s holding me over until this gets working.
I have contacted the theme author, and he attributes this to your plugin. I couldn’t find anything related to a similar problem.
My wp-content directory has full perms available when I run your plugin.
What can be going wrong?
Thank you.
Heh, been using this plugin setting up my online store and noticed a familiar name
Greetings from a FinalGear regular! Thanks for the great little plugin.
Hi and thanks for this great plug-in! I have just one question: after regenerating thumbnails, does it also remove “old” thumbs? We have a site with MANY images and we don’t want to waste HDD space (and also manually searching and deleting redundant thumbs).
Thanks much!
No it doesn’t remove old thumbnail images because they could be used within a post where thumbnail URLs are hard-coded.
HI
Im try to use your plugin. But I need make some changes.
I need send the thumb picture to Amazon S3 service!
Can you give me a clue about how can modify your plugin to reach my goal.
Thanks, Nicolas
Hi Viper-
This plugin has helped me out on several occasions now. Thanks a bunch.
hi! I stumbled across your plugin because my theme uses timthumb which automatically makes different sizes of my images and does some pretty bad cropping in the process. Does your plugin override timthumb? For example, the featured image in each blog post is displayed in the blog roll page with some terrible cropped versions . I am hoping your plug in will allow me to manually make each version? thanks!
My plugin doesn’t implement any custom functionality. You should be using the core WordPress functionality to display images.
My plugin simply makes sure that thumbnail files exist for all thumbnail sizes that you have registered with WordPress via your theme and/or plugins, i.e. via
set_post_thumbnail_size()andadd_image_size(). Since WordPress only creates thumbnails on upload (unlike TimThumb which makes them on-demand), my plugin allows you to create thumbnails for old uploads after changing your thumbnail sizes.ok darn. hm. I don’t suppose you have any recommendations as to how to either turn tinthumb off or find a function that overrides it?
Use a better theme that doesn’t rely on TimThumb would honestly be the easiest solution, otherwise you’re going to have to go through the theme’s code and replace it’s uses of TimThumb with the native WordPress functionality.
HI Alex, is this tested with WP3.5?
Yep, it works fine. I even released a small bugfix for it.
The “Compatible up to” value is manually set by the author and requires me remembering to update it. Instead check out the “Compatibility” box on WordPress.org which is a better (but not perfect either) indicator of if it works or not.
I’ll manually update the number though.
Sounds good; thanks Alex!
ps…Feel good to be back in the Viper again?
Hi Alex,
when I regenerate the thumbnails, does the name of the picture change. For example now my picture is named “src=”…/uploads/2012/08/image-picture-200×300.jpg. When I regenerate for example to 300×450 px is the picture now named … picture-300×450 and do I therefore need to change all my posts where I included pictures manually? Or are the old pictures kept in the uploads folder anyway?
Thanks and best regards
Sven
The thumbnail filename always references its size — it never lies. For example
image-picture-200×300.jpgis never going to be 300 x 450 pixels.However no thumbnail files will be deleted so your old posts will continue to work fine. However they will keep referencing the old sized thumbnail images because those sizes are hard-coded. Only things like galleries and post thumbnails will start referencing the new sizes.
I’ve thought about introducing functionality to my plugin that will loop through all posts and update the HTML but it’s not a simple process. It’s still on the drawing board though and I hope to eventually add such functionality.
Hi Alex, thanks for your quick reply – as long as the old thumbs still exist, everything is fine for me.
best regards
Sven
Hello Alex
It’s possible to bulk update all the images alt text metadata?
Not at this time.
hello alex!
I tried to use your very useful plugin but unfortunately its not working on my site. what am I doing wrong?
was changing the image size in Settings – Media and Woocommerce, but catalog-images are still the same size….
thank you for your help!
greetings
steffi
Sorry, I’ve never used that plugin so I don’t know how it works.
Really nice plugin. I am not understand plugin thumbnail error message. please help me.
Okay, so I installed the plugin after I added a new image size for a custom post type. When running it, though, all the plugin does, is delete all sizes except the original image. There are no error messages, it claims success, but it just deletes all my generated image sizes.
I was regenerating images no problem when I started getting the jQuery bug message:
function (){if(c){var a=c.length;n(arguments),j?l=c.length:e&&e!==!0&&(k=a,o(e[0],e[1]))}return this}.
So I checked the AJAX response in Firebug and it showed this:
Warning: getimagesize(/wp-content/uploads/2013/01/image-600×600.png) [function.getimagesize]: failed to open stream: No such file or directory in /wp-content/plugins/simple-image-watermark/simple-image-watermark.php on line 267
The weird thing is the image was uploaded in December of 2012 so the file path is
/wp-content/uploads/2012/12/image-600×600.png
NOT
/wp-content/uploads/2013/01/image-600×600.png
Everything uploaded in January 2013 worked but any other month gave me the same error.
Why isn’t it looking in the correct folder? Is there a workaround?
I would greatly appreciate any help!
For the JavaScript error, are you using the latest version of the plugin? I thought I fixed that by making sure the AJAX response was valid first.
For the path, I don’t know — that’s supplied entirely by WordPress.
Thank you for the quick reply!
I do have the latest version. As a test, I changed the name of the folder in filezilla then, as expected, I get the file path error instead: The originally uploaded image file cannot be found /wp-content/uploads/2012/12/image.png. According to that message it is looking in the right place (2012/12 folder).
Can you make any sense of that?
Oh, I didn’t fully read the error message before. Your issues are being causes by the “simple-image-watermark” plugin. Disable it.
Great, working now.Not sure how I missed that one. Thank you Alex!
It’s okay — I missed it too.
Hi !
One of my customer simply replace his image in the FTP, and update his article (the article contains charts).
So, i have to re-generate the image every time the post will be save in case the image was FTP updated.
Could i do that with the action “wp_ajax_regeneratethumbnail” (i know how to recover the ID of the image – and i could call the action in a foreach) ? Is the function was made for ?
Thank you !
General advice: With WordPress the customer should not be able to “mess around” with FTP as this can corrupt also a lot of metadata in database.
Yeah, i know.
And it does’nt want to change that
But the customer work like that since few years
Thanks for making this! Sorry you have to answer all these stupid questions, but you’re a good person for doing so anyway.
Thanks for this great plugin! Just one quick question to make sure I understand right: If I change the “full-size” dimension of my pictures and run your plugin, will this also affect images I inserted via the “caption”/insert media butoon? I guess not (as least it doesn’t do it in my case ….)
Do you know of any script solution to this? I guess it affects pretty much anyone who ever changes their theme ….
THX!
Hey…I’m getting errors where it can’t find the images with a pathname of this:
“sanctuary-1″ (ID 8032) failed to resize. The error message was: The originally uploaded image file cannot be found at /nfs/c02/h04/mnt/43539/domains/popcritics.com/html/wp-content/uploads/2008/10/sanctuary-1.jpg
I can see the image in my media section…and when I click the little “regen” link next to it, I get this error.
Any ideas why it’s looking where it is?
Could it be because I’m playing on a test server right now with my hosts file changed? Maybe this plugin is actually looking up the image location on the server that’s live right now?
Yes, that’s exactly why. When you upload an image and the attachment entry is created, WordPress stores the full path to the image file. My plugin uses this path, supplied by WordPress, when doing the resizing.
I’m not sure why WordPress stores the full path instead of just the relative path. Seems silly.
Any thoughts about how to make this work with the various Amazon S3 plugins out there? My thumbs no longer exist on my local machine, so either I need to somehow mount my S3 bucket onto my local machine, or I need to modify the plugin to know how to read/write to S3 or interact with the plugins.
Any thoughts?
Thanks!
The thumbnails don’t need to exist locally, only the originals do. But assuming that’s what you meant, then figuring out how to mount the S3 bucket would be the best solution. This plugin uses core WordPress functionality to generate the thumbnails (it just calls the same functions that are called on upload). That’s assuming the S3 plugin you’re using hasn’t filtered those functions to generate the thumbnails remotely.
Regardless, I’m afraid you’re on your own for this one. Sorry.
great plugin..
but my images are not fitting in their areas snug…do you know why?
Hi,
On WordPress 3.5.1, regenerate works only for 1 image, but not for other.
Very strange.
Thank you in advance.
Hi, I have just used your program but for some reason all my images are blurry. Any ideas on how to fix this ? Thanks, James.
Do I have to leave this activated after successfully regenerating my thumbnails? Or is it ok to deactivate and/or delete this (great!) plugin now that everything’s done?
Yep, all good to deactivate it when you’re done!
Hi, once more one of these questions – “why doesn’t it work on my installation?”
Well I moved my blog to a new machine and did set up wp entirerly new. Befor the
the thumbs were stored in the wp-contents upload file. Now they don’t appear anywhere.
Unfortuately I the over all process lookes good. I can’t find any error messages.
And I can’t coose a differnt size when posting pictures.
Do you have any suggestions? Thanks
Ok I could fix it, I didn’t had all apache modules. But anyway the the plugin didn’t throw any warning about this, but sait something like “success – no failure”. Any way – many thanks for the plug in!
Can’t get this to work right on a wordpress install for some reason. It works with the same theme same code on another install on a different server but on this one it runs through the “Create Thumbnail Process” but never creates any thumbnails on the server. This appears to be a conflict with something within the server but I have no idea what it is conflicting with.
What would be stopping the writing of thumbnails but not showing up an error. It looks like a similar problem to marek…
any ideas why this would happen?
I can’t seem to be able to regenerate my files, it keeps giving me errors such as “function (){if(c){var a=c.length;m(arguments),i?k=c.length:e&&e!==!0&&(j=a,n(e[0],e[1]))}return this”
Hi,
i used your plugin, but instead of selecting one plugin I had all my thumbnails images resized. Now the one I wanted to re size looks great but the rest looks much worth than before. Tried to delete the plugin and re uploading the images but it’s still the same.
Any idea how I could reverse the process? Let me know, thanks!
Must have plugin for WP, very easy to use.
You should add an option to regenerate from the Edit Attachment screen. I’ll send you a diff on the svn repo if you’re interested.
Used this on the “Nexus” theme and it totally destroyed the way my website looks. Resized TONS of images and this was recommended to be used by woocommerce when resizing product thumbnails… any way to revert the changes?
Hello,
After changing the WordPress URL and Site URL under General Settings, I received the following error when attempting to regenerate thumbnails:
function (){if(a){var t=a.length;(function r(t){v.each(t,function(t,n){var i=v.type(n);i===”function”?(!e.unique||!c.has(n))&&a.push(n):n&&n.length&&i!==”string”&&r(n)})})(arguments),i?o=a.length:n&&(s=t,l(n))}return this}
When I revert the URL’s back, it is successful. I need to keep the new URL values, so any ideas on on how to prevent the error from occurring for future regeneration without having to switch the URLs?
Thanks.
Errors like that happen when the AJAX endpoint returns an invalid response. I thought I fixed that by checking to make sure the response was valid before trying to use it.
Do you know how to use your browser’s developer tools to inspect the AJAX request to see what the response’s body is?
I’ve used Firebug to inspect HTML elements, but have not used any tools to dissect AJAX issues. Can you point me in the right direction so I can get the info out to you?
I haven’t used Firebug in years but here’s how to do it using Firefox’s built-in tools:
/wp-admin/admin-ajax.phpand scroll down to “Response Body”.Thanks for the help.