WordPress GuideImages → Change Thumbnail

How to change the thumbnail size in WordPress: PHP and more

WordPress thumbnails look simple—but they carry a surprising amount of influence. Whether you’re trying to clean up your blog layout or improve page speed, getting thumbnail sizes right is essential.

Let’s walk through how to change WordPress thumbnail size using PHP, plugins, and built-in settings—plus some lesser-known tips for better performance.

Get fast, reliable hosting for WordPress

Power your site with the industry’s fastest, most optimized WordPress hosting

Why change WordPress thumbnail size?

WordPress creates several image sizes every time you upload a photo. These include “thumbnail,” “medium,” and “large” sizes, which are used in everything from blog excerpts to product galleries.

You might want to resize thumbnails if:

Thumbnail size affects both aesthetics and performance. It’s worth getting right.

Understanding default thumbnail sizes in WordPress

By default, WordPress generates three sizes for every image you upload:

You can view and change these values from your WordPress dashboard under Settings > Media. However, any changes only apply to new image uploads. Existing media will stay the same unless you regenerate thumbnails.

Method 1: Change thumbnail sizes in WordPress settings

If you just want to update the default sizes, the easiest option is the built-in Media Settings panel.

Keep in mind, this will only affect images uploaded after the change. Use a plugin like Force Regenerate Thumbnails to apply new sizes to old uploads.

Method 2: Resize thumbnails using PHP in your theme

For more control, or if you’re building a custom theme, you can change thumbnail sizes using code.

After adding or changing sizes in code, install and run the Regenerate Thumbnails plugin so WordPress can generate the correct versions for your existing images.

Method 3: Use a plugin to change thumbnail sizes

If you prefer not to touch code, plugins make it easy to resize and regenerate thumbnails.

Popular options include:

With these plugins, you can:

Method 4: Adjust thumbnail size in a page builder or theme

Themes and page builders often override or enhance WordPress’s thumbnail handling. For example:

Always check your theme or page builder’s documentation. Using the tools built into your design stack can avoid conflicts or unexpected layout issues.

Method 5: Crop or force exact thumbnail dimensions

Sometimes you want thumbnails to be exactly a certain size, especially if you’re designing a grid layout.

In PHP, this is done by enabling hard cropping:

set_post_thumbnail_size(300, 200, true); // true = hard crop

You can also apply this to any custom size using add_image_size() with the true flag.

Prefer a visual approach? The Crop-Thumbnails plugin lets you adjust crop areas for each image individually, ensuring the right parts of your images are visible in thumbnails.

Pro tip: Optimize thumbnail sizes for mobile performance

Here’s where you can take things further than most WordPress users: optimizing for mobile performance.

WordPress automatically uses srcset to serve responsive images, but you can improve this by registering a mobile-specific image size:

add_image_size(‘thumb-mobile’, 150, 100, true);

Then, in your templates, conditionally use this size for mobile users. This reduces image payload and improves performance on small devices. You can also use plugins like Imsanity to prevent large images from being uploaded in the first place.

Image thumbnail FAQs

You can change the size under Settings > Media > Thumbnail size. To affect existing images, you’ll need to regenerate thumbnails using a plugin like Regenerate Thumbnails.

Use PHP in your theme’s functions.php:

set_post_thumbnail_size(width, height, true);

The true value enforces a hard crop. Plugins like Crop-Thumbnails offer UI-based cropping controls as well.

Divi’s default thumbnail size is 400×284, but you can override this inside the Divi Builder’s Image Module. Divi also supports WordPress-registered sizes and responsive images through srcset.

Check your theme’s thumbnail size with set_post_thumbnail_size(), and confirm any template uses the correct size like the_post_thumbnail(‘medium’). Then run Regenerate Thumbnails to apply updates. Custom CSS may also be needed to align image containers.

Ready to get started?

Get the fastest, most secure WordPress.org hosting on the market.

Trust us to help you choose the ideal hosting solution

Loading form…