Thumbnails are resized versions of images that WordPress creates automatically during uploads. They act as previews for larger images and are commonly used in posts, galleries and featured sections. Default sizes include Thumbnail, Medium, Large and Full, making it easier to display visuals across various layouts without compromising site speed.
How WordPress Handles Thumbnails
WordPress automatically resizes images upon upload based on your theme’s specifications and Media settings. Each theme may define unique image sizes. For example, blog themes might prioritise portrait thumbnails while eCommerce themes may use square or landscape dimensions. You can customise these settings under Settings > Media to better fit your needs.
The Impact of Themes on Thumbnail Sizes
Changing themes can cause thumbnails to mismatch new specifications. A new theme may define different sizes from your previous theme, requiring old thumbnails to be updated. For instance, switching from a blog to an eCommerce theme might awkwardly stretch or crop product images. Regenerating thumbnails ensures all images match the updated size requirements, maintaining a cohesive appearance.
Why Regenerate Thumbnails?
Regenerating thumbnails keeps your WordPress site visually consistent and professional. When you change themes or settings, old thumbnails often do not fit the new dimensions, potentially distorting images or making your site look unpolished. By regenerating thumbnails, you align all images to the latest requirements, improving user experience, boosting click-through rates and helping free up server space.
Key Benefits
Aligning Older Images with New Theme Requirements
New themes often introduce different image sizes, so old thumbnails will not match these settings. Regeneration updates all thumbnails to fit the new theme perfectly.
Fixing Distorted or Stretched Images
Outdated image dimensions can make thumbnails appear stretched or cropped. Regenerating fixes these issues, making images sharp and proportional.
Improving User Experience and CTR
Attractive, well-sized thumbnails grab attention and encourage clicks, especially for featured posts or WooCommerce products.
Freeing Up Server Space
Over time, unused image sizes accumulate. Regenerating lets you delete these files, freeing valuable server space and improving performance.
Common Use Cases
Post-Theme Switch Updates
A new theme often requires resizing older images. Regeneration ensures thumbnails match updated settings.
Fixing Broken or Outdated Thumbnails After Site Import
Migrating a site can disrupt image sizes. Regenerating resolves broken or missing thumbnails, ensuring everything displays properly.
Optimising WooCommerce or Plugin Images
Plugins like WooCommerce require specific image sizes for products. Regenerating thumbnails ensures seamless integration and better presentation.
Methods to Regenerate Thumbnails
Using Plugins
Regenerate Thumbnails Plugin
The Regenerate Thumbnails plugin (by Alex Mills) is widely used, with over 1 million installs, and works seamlessly for beginners.
Installation steps:
- Go to Plugins > Add New in your WordPress dashboard
- Search for Regenerate Thumbnails by Alex Mills
- Click Install Now and then Activate
Regenerate all thumbnails: navigate to Tools > Regenerate Thumbnails and click the Regenerate All Thumbnails button. The plugin resizes all images based on current settings.
Regenerate specific thumbnails: go to Media > Library, switch to list view, hover over an image and click Regenerate Thumbnails.
Customisation options:
- Skip correctly-sized thumbnails: saves time by skipping images already matching desired dimensions
- Delete old image sizes: frees server space by removing unused thumbnails
Force Regenerate Thumbnails Plugin
This plugin deletes outdated image sizes before creating new ones, useful for a clean slate but requiring caution.
Steps to use:
- Install and activate the plugin
- Go to Tools > Force Regenerate Thumbnails
- Click Regenerate All Thumbnails
Unlike the Regenerate Thumbnails plugin, this removes old image sizes entirely. It is ideal for resolving conflicts or server space issues. The plugin has not been updated frequently, so test it on a staging site before use.
Using WP-CLI (Command Line Interface)
WP-CLI is a powerful tool for advanced users that regenerates thumbnails faster and avoids HTTP request limitations.
Requirements: server access and basic knowledge of command-line tools.
Commands for thumbnail regeneration: the basic command is wp media regenerate, which regenerates thumbnails for all images. To regenerate specific images, use wp media regenerate 123 456, and to skip confirmation add the --yes flag.
When to use WP-CLI: best for large sites with thousands of images. It avoids plugin-related overhead and HTTP timeouts, and works well for bulk regeneration or updating specific images without affecting others.
Manual Methods (Custom Code)
Adding a Custom Function
For lightweight sites, you can add a custom function to your theme’s functions.php file that loops through every attachment, fetches the attached file with get_attached_file, and rebuilds the metadata using wp_generate_attachment_metadata and wp_update_attachment_metadata.
Running the function: create a custom admin page to trigger the function, or run it directly from your code editor.
When manual methods are useful: ideal for developers maintaining plugin-free sites. It provides full control over the process.
Best practices: back up your site before making changes, and test the function in a staging environment to avoid errors.
Comparison Table of Methods to Regenerate Thumbnails
| Method | Description | Best For | Key Tools |
|---|---|---|---|
| Regenerate Thumbnails Plugin | Easy-to-use plugin to resize all or specific thumbnails to match current settings | Beginners and quick updates | Regenerate Thumbnails plugin |
| Force Regenerate Thumbnails Plugin | Deletes old image sizes before regenerating new ones for a clean reset | Cleaning up outdated image sizes | Force Regenerate Thumbnails plugin |
| WP-CLI (Command Line) | Advanced tool for regenerating thumbnails directly via server commands | Large media libraries and advanced users | WP-CLI |
| Custom Code | Lightweight, code-based method using PHP functions for regeneration | Developers and plugin-free setups | Custom function in functions.php |
Managed Hosting solutions for WordPress backed by Speed, Security and Scalability
Talk To Sales →Advanced Considerations
Best Practices for Regenerating Thumbnails
Backup recommendations before regenerating: always back up your site before starting. Use tools like UpdraftPlus to save your database and media files, preventing data loss if something goes wrong.
Testing on staging environments: test changes on a staging site before applying them live, ensuring thumbnails regenerate correctly without disrupting your main site.
Handling large media libraries efficiently: for websites with thousands of images, regenerate in batches to avoid server overload. Use WP-CLI for faster processing and less resource strain.
Troubleshooting Common Issues
Distorted or missing thumbnails after regeneration: check your theme’s image dimensions in Media settings. If sizes do not match, regenerate thumbnails again using updated settings.
File permission errors in the uploads folder: ensure your wp-content/uploads folder has permissions of 755 or 775. Incorrect permissions can block thumbnail creation.
Ensuring the PHP GD library is installed and enabled: the PHP GD library processes images in WordPress. Contact your host to verify it is active on your server if thumbnails fail.
Addressing server performance bottlenecks: large sites can face slowdowns during regeneration. Increase PHP memory limits or switch to a high-performance hosting plan to avoid downtime.
Optimising Thumbnail Regeneration
Compressing regenerated images: after regeneration, use tools like Optimole or ShortPixel to compress images, reducing file size without sacrificing quality.
Using lazy loading to enhance page speed: enable lazy loading for thumbnails, ensuring images load only when needed and reducing initial page load time.
Combining thumbnail regeneration with other tasks: take the opportunity to clean up your media library by deleting unused images, updating alt texts and organising files.
Tools and Plugins for Thumbnail Management
Regenerate Thumbnails
This plugin is a go-to for resizing thumbnails, working quickly and remaining user-friendly. It regenerates all or specific thumbnails based on current theme settings and offers options to skip correctly sized images or delete unused sizes. It is ideal after a theme switch or media setting update.
Force Regenerate Thumbnails
This plugin deletes old image sizes before regenerating new ones, ensuring a fresh start. Use it when server space is limited or if outdated sizes create clutter, and to fix persistent image display issues. Test it on a staging site before using it on live websites to avoid data loss.
Optimole and Other Compression Tools
Compression tools like Optimole and ShortPixel enhance thumbnail quality and reduce file size. Compressed images load faster without losing clarity and support automatic resizing for responsive design, which is perfect for optimising regenerated thumbnails on media-heavy sites.
Alternative Plugins for Image Management
Media Cleaner: removes unused or broken media files from your library, ideal for decluttering after thumbnail regeneration. EWWW Image Optimizer: optimises images for faster loading and automatically compresses images as you upload them.
Comparison Table of Thumbnail Management Tools
| Tool/Plugin | Description | Best Use Case | Key Features |
|---|---|---|---|
| Regenerate Thumbnails | Resize all or specific thumbnails to fit current settings | After theme changes or Media setting updates | Skips correctly sized images and deletes unused sizes |
| Force Regenerate Thumbnails | Deletes old image sizes before regenerating new ones | Cleaning up server space or fixing clutter | Removes outdated sizes and regenerates fresh thumbnails |
| Optimole | Compresses and optimises images for faster loading | Improving page speed after regeneration | Automatic compression, responsive resizing |
| ShortPixel | Enhances image quality while reducing file size | Optimising regenerated thumbnails | Supports various compression levels |
| Media Cleaner | Removes unused or broken media files | Cleaning up the library after regeneration | Detects unused images and organises media files |
| EWWW Image Optimizer | Compresses and optimises images during uploads | Maintaining optimised media libraries | Automatic optimisation, bulk optimisation |
Conclusion
Regenerating thumbnails keeps your WordPress site visually consistent and professional. It fixes distorted or outdated images, aligns thumbnails with new themes and improves user experience. Whether you use plugins, WP-CLI or custom code, choose a method matching your skills and website needs.
Before starting, back up your site and test on a staging environment. Use tools like Optimole or ShortPixel to compress images and boost page speed, and regularly clean up unused media files to maintain an optimised library. A well-managed thumbnail system ensures your site runs smoothly, looks great and delivers the best visitor experience.