Give every thumbnail slot the same aspect ratio, then choose whether images should fill the frame and crop or remain fully visible with empty space around them. Do not stretch every image to identical dimensions: stretching changes its proportions and distorts the subject.
Choose how thumbnails should fit
First decide what “the same size” means for your page: identical-shaped display boxes, identically sized image files, or both. For most website grids, consistent display boxes are what create a tidy layout; the source images can have different dimensions.
| Approach | What you get | Trade-off | Best for |
|---|---|---|---|
| Cover and crop | A filled frame with a consistent shape | Parts near the edges may be cut off | Uniform cards, galleries, and grids |
| Contain or proportional fit | The full image remains visible | Unused space may appear inside the frame | Product images, diagrams, or images where no detail can be lost |
| Generated image size | A reusable server-generated size, with crop behavior you choose | Hard crops remove content; proportional resizing does not guarantee a filled frame | Recurring components managed in WordPress |
These are separate decisions: the aspect ratio sets the frame shape, the fit and focal point determine what remains visible, and source resolution affects sharpness.
Use CSS for a consistent display frame
For a typical thumbnail grid, set the box’s aspect ratio and let the image cover it. This example creates 16:9 frames. Change the ratio to suit the component, such as 4:3 or 1:1.
The Tool Desk
Outbyte PC Repair FREEClear out junk files and repair common Windows errorsFree Scan →Outbyte Driver Updater FREEScan for outdated or missing drivers - takes under a minuteDriver Scan →#1 Best Overall
.thumbnail {
aspect-ratio: 16 / 9;
overflow: hidden;
}
.thumbnail img {
display: block;
width: 100%;
height: 100%;
object-fit: cover;
object-position: center;
}
<div class="thumbnail">
<img src="/images/article-thumb.jpg" alt="A person working at a desk">
</div>
The fixed ratio keeps the displayed boxes consistent even when the source images have different ratios. The cover fit fills each frame by cropping the excess. Adjust the image’s object-position when the important subject is not centered; for example, object-position: 70% center shifts the visible area toward the right side of the source. Check representative images at desktop and mobile widths so the chosen crop does not hide faces, text, or other important details.
Preserve the entire image instead
When cropping would remove necessary content, use object-fit: contain. The full image stays in view, but a source whose aspect ratio differs from its frame will leave unused space in one direction. Give the frame a background color if that space should be visually intentional.
Rank #2
.thumbnail img {
display: block;
width: 100%;
height: 100%;
object-fit: contain;
}
Set thumbnail behavior in WordPress
For a block-editor image
In the Image block, choose an aspect ratio and set the image scaling behavior to Cover or Contain. Cover fills the area and may crop; Contain shows the full image and may leave empty space. With Cover, use the focal-point control to move the subject into view. These presentation settings can change how the image appears without changing the original file.
For a recurring theme component
Register a named image size with add_image_size(). A hard crop produces the requested dimensions and can use a crop position; proportional resizing avoids cutting off the source but may not fill the exact rectangle.
Do these 3 things before closing this tab:
1Scan for outdated or missing drivers - takes under a minute2Repair Windows errors before they cause bigger problems3Fix the driver behind crashes, sound loss and screen glitchesRank #3
// In a theme or plugin PHP file:
add_action( 'after_setup_theme', function () {
add_image_size( 'article-card', 640, 360, true );
} );
The final true requests a hard crop. For proportional resizing, use false instead. A crop-position array can specify a position such as array( 'left', 'top' ) in place of the boolean. Use the corresponding registered size when requesting the image for the component, rather than loading the original by default.
set_post_thumbnail_size() can also set the featured-image size: with crop disabled it scales proportionally; with crop enabled it crops, and a crop-position array can specify the position.
Rank #4
WordPress documents its default thumbnail as 150 × 150 pixels with square cropping; this is a configurable product default, not a recommendation for every site. Media settings can adjust it. If you change registered dimensions, existing generated images do not automatically acquire the new size. Regenerate thumbnails for existing media using an appropriate site workflow, then check the affected pages.
Choose dimensions without wasting image data
A consistent frame does not require every original upload to have identical pixel dimensions. Choose an output size suitable for the component and the sharpness required at its actual display size. Serving an unnecessarily large original can increase transferred image data; serving one that is too small can look soft.
Best Value
- Use responsive image support so the browser can select a more suitable source size for the display context instead of always downloading the largest original.
- Test the component at the largest size it will actually be displayed, including high-density screens where applicable.
- Keep the frame ratio consistent while letting responsive source selection handle the appropriate image data.
- Inspect both the crop and the rendered sharpness after changing theme sizes or upload workflows.
Or skip the browser setup
If you need to create a screenshot thumbnail of a webpage, rather than resize or crop an image already on your site, ScreenshotNeo can return a screenshot from one GET request. This is a separate workflow from setting a site’s thumbnail CSS or WordPress image sizes. To request a WebP screenshot, use the API example below; the API documentation lists its options and response details.
curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://stripe.com -o shot.webp
See the ScreenshotNeo API documentation. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed. An MCP server lets AI agents take screenshots. The free plan includes 1,000 screenshots a month with no card; paid plans start at $5 for 3,000.
Sign up for 1,000 free screenshots a month, with no card required.
Quick Recap
Troubleshoot common thumbnail problems
- Images look stretched: Do not force both width and height on an image without a fit rule. Use a fixed-ratio frame with Cover or Contain, or proportional dimensions.
- Important content is cut off: Use Contain if the whole image must remain visible, or adjust the focal point or object position for a crop.
- Some frames show blank space: This is expected with Contain when image and frame ratios differ. Use Cover only if cropping is acceptable.
- WordPress images still use the old dimensions: Newly registered sizes do not resize previously generated thumbnails automatically. Regenerate existing thumbnails and verify the selected size is used by the component.
- Thumbnails look soft: Check the actual rendered size and available source resolution; make sure the selected responsive source is not smaller than the display requires.
- Pages transfer more image data than expected: Check whether the component is loading full-size originals where a responsive image candidate would suffice.
Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.
Free tools Windows power users keep installed
One-click scans. No signup required.




