In itself, regenerating thumbnails of images in WordPress is not rocket science except that it requires a little bit of preparation.


  • What does regenerating WordPress images mean?
    • Why resort to it?
    • What are the native sizes of the thumbnails in WordPress?
  • Define new thumbnail sizes in WordPress
    • Generate new image sizes via functions.php
  • Regenerate Thumbnails : le plugin magique made in WordPress
    • Why use Regenerate Thumbnails?
    • How do I use Regenerate Thumbnails?
  • Regenerating image thumbnails is easy as pie!

What does regenerating WordPress images mean?

First of all, what do we mean by “regenerate thumbnails” in WordPress? In fact, it is an operation whose principle is very simple. It just consists of deleting all your images to recreate them in new sizes.

kinsta wordpress attachment details edit image 1024x634 1
Regenerate WordPress thumbnails: A must-know trick! 3

Why resort to it?

For different reasons, you may be showing a lot of images on your website. Only then, you realize one day that your photos are badly sized. Indeed, a too small image stretched via CSS code can be a real foil for your visitors. Or, you display a small image while the original downloaded file is very large and therefore very heavy, which unnecessarily increases the loading time of the page. Finally, you may want to opt for a theme in which the thumbnail sizes are different from those you are currently using. DISASTER! In fact, not that much, don’t worry.

What are the native sizes of the thumbnails in WordPress?

However, you can play around with what I call WordPress native image sizes. Indeed, by default, three sizes are generated automatically by the system in addition to the original size. And, of course, all themes use them. They are called Thumbnail (150 × 150 by default), Medium (300 × 300 by default) and Large (1024 × 1024 by default). Finally, Full means the original photo you uploaded in its original dimensions.

Some plugins or themes may add other sizes to suit their layout. Among the themes, we find in particular those installed natively on WordPress like TwentyTewenty. As for the plugin department, the first to use this method are page builders like Elementor , DIVI or, in another genre, Woocommerce .

Themes or even plugins like Elementor or Woocommerce generate their own thumbnail sizes on WordPress.

Define new thumbnail sizes in WordPress

So, it can be very easy for you to adjust the size of your images however you like. For that, you just have to modify the three default sizes generated by WordPress. Go to the administration of your site then in Settings → Media.

See also  How To Import External Images Into WordPress

On WordPress, the 3 native sizes can be modified directly in the settings.

In the panel that appears, you just have to enter the desired dimensions in each drop-down menu dedicated to the size in question. There are two per size: width and height. Indeed, all the images are not in square format… It is even possible to force the images to be cropped to avoid stretching it during resizing. You just have to check the corresponding box.

Generate new image sizes via functions.php

The previously mentioned method is simple. In addition, it does not ask to put your fingers in the code. However, it also has its drawbacks. Indeed, the number of sizes is very limited. This can be a bit of a handicap at a time when screen sizes are increasing. In addition, we must also anticipate that the same photo can be displayed in different sizes depending on the page on which it appears. Short. Generating more than three custom sizes can be a good option.

Well, I’ve got some good news and some bad news for you. The bad news is, you’re going to have to code a little bit. The good news is, it’s very easy to do! To carry out this operation, you must modify a file of your theme. In this regard, I strongly advise you, if you haven’t already done so, to create a child theme. If not, your changes will disappear the next time you update your theme. 

Go to your theme files on your server. You will need a tool like Filezilla to achieve this. Go to the wp-content → Theme folder then the folder containing your child theme. Then, open the functions.php file . After the code already entered, enter this line:

add_image_size ('new-size', 1080, 720, false);

Between the single quotes, you can write the name you want to give to the new size that will be generated. Attention, no space, no special character! Then the first number is the width in pixels while the second is the height. Finally, write true without quotes if you want to allow cropping and false if you do not want it. You can repeat this line as many times as you want. Although, remember to give a different name to each new size generated!

See also  How to download photos and videos from Instagram?

So, here is an example of what your new functions.php might look like .

On WordPress, you can generate as many photo sizes as you want via the functions.php.

Regenerate Thumbnails : le plugin magique made in WordPress

All of this may sound fine. However, despite these settings, your old image sizes are still there. Worse ! None of the supposedly created news is on the horizon. Yet there is a very simple reason for this. Indeed, these settings that you have scrupulously made will only be effective for the next downloaded images. God damn it!

Rest assured, these small explanations will not have been useless. On the one hand, they can still be used. On the other hand, these settings will also be used in the process of regenerating the miniatures. Because yes, deleting the old thumbnails is one thing, but you still have to have new sizes registered to finalize the operation!

Precisely, to achieve this manipulation, we have a reference plugin on WordPress: Regenerate Thumbnails .

regenerate thumbnails

Why use Regenerate Thumbnails?

Indeed, there are many plugins dedicated to this task on the official WordPress directory. Among them, we will notably remember reGenerate Thumbnails Advanced by ShortPixel, the merits of which I have already praised . But also WordPress Real Thumbnail Generator .

So why specifically Regenerate Thumbnails? Well because it’s the most used with 1 million active installs and an overall 4.5 star rating from users. I will even add its advantage of not creating anything in the database whether it is a table or a row in the options table . This is an advantage insofar as the plugin is very demanding in terms of performance. Thus, you can delete it as soon as the manipulation is finished without qualms and without risking breaking your site’s database afterwards.

How do I use Regenerate Thumbnails?

Now that you’ve got drooling feverishly waiting for me to share my final secrets with you, let’s get to the point. How to regenerate your thumbnails in just a few clicks? First of all, head to the official directory or Extensions → Add in your WordPress administration panel. Install the Regenerate Thumbnails plugin then activate it .

See also  Hide spoilers on websites with this free plugin

With the Regenerate Thumbnails plugin, regenerate all your image thumbnails on WordPress in one click with all the essential options.

Then, direction Tools → Regenerate image thumbnails. A panel opens with everything you need to know. Moreover, by taking a look, you will notice that the development team has thought of (almost) everything! This is because it may not be useful to regenerate the image sizes you are still using (if they exist). So check the first box so as not to unnecessarily lengthen the process. Do you want to delete the old sizes that you will no longer use? Check the second box!

Under the button to launch the process (which informs you in passing of the number of media files present in your media library), you will find a summary of all the sizes in force and which will be taken into account during the regeneration. These are the native sizes of your photos that you modified previously, those created by your plugins or even those created manually in the functions.php. Hence the interest of correctly naming each new size to navigate!

Click on the blue button and let’s go! The length of the process depends on the number of files to regenerate and the number of sizes to produce! So a little patience!

Regenerating image thumbnails is easy as pie!

In itself, regenerating thumbnails of images in WordPress is not rocket science. However, the structure of this article will surely have taught you that this task requires a little preparation. Indeed, you need to know the image sizes to generate depending on the tools you use (theme, plugins, page builder, etc.). Then you must then proceed to the settings according to the various methods presented. It is only then that the actual regeneration takes place.

That said, now you have no excuse to drop this theme you no longer want! And without losing your meticulous optimization settings! Enjoy!

Please Share the post “Regenerating WordPress thumbnails

5/5 - (2 votes)

Tagged in:


About the Author

SAKHRI Mohamed

Founder & Editor

Passionate about the web, new technologies and IT, I share on tutorials, tips, advice, online tools and software for Windows, Mac and Linux. I'm the founder of this blog and I'm very interested in anything to do with technology, but I also love playing games. I was born in Constantine, but now I live in Algiers/Algeria

View All Articles