October DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowOctober DealsAmazon USDeal season is back - check today's better picksAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk6 min

How to Generate Thumbnail Images from WordPress Pages

Learn how to assign WordPress page featured images, register a layout-matched thumbnail size, display it in a template, and regenerate older uploads.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

To generate thumbnail images for WordPress pages, enable featured images in your theme, register an image size that fits your layout, assign a featured image to each page, and request the registered size in your template. If you add or change the size after images are already in the Media Library, regenerate those image files; changing theme code alone does not rebuild them.

What “thumbnail” means in WordPress

WordPress uses “Featured Image” and “Post Thumbnail” for the image that represents a page, post, or custom post type. A thumbnail can also mean a smaller, generated image file derived from an upload. Assigning a featured image chooses the source image for content; registering an image size tells WordPress what derivative to create and lets template code request it.

As an Amazon Associate I earn from qualifying purchases.

The steps below cover both meanings: assigning an image to a page and generating and displaying a layout-sized derivative.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Enable featured images for pages

Your theme must support post thumbnails for the Featured Image control to appear in the editor. Add this to the theme’s setup code, commonly in functions.php or a file loaded by it:

add_action( 'after_setup_theme', function () {
    add_theme_support( 'post-thumbnails' );
} );

If you want support limited to pages rather than all supported post types, you can scope it:

add_action( 'after_setup_theme', function () {
    add_theme_support( 'post-thumbnails', array( 'page' ) );
} );

Make theme changes in a child theme or another maintainable theme-code location so an update does not overwrite them. If your site uses a block theme or a page builder, check its documentation too: its editor controls and templates may differ from a classic theme’s.

Register an image size for the page layout

Choose dimensions and a crop that match the actual card, archive, or page layout where the image will appear. Register a named size during theme setup:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
add_action( 'after_setup_theme', function () {
    add_theme_support( 'post-thumbnails' );
    add_image_size( 'page-card', 640, 360, true );
} );

Here, page-card is the size name, and 640 by 360 defines a fixed frame. With the final argument set to true, WordPress crops to that frame, centered by default. The crop can instead specify horizontal and vertical positions:

add_image_size( 'page-card', 640, 360, array( 'center', 'top' ) );

Use false for proportional scaling instead of a hard crop:

add_image_size( 'page-card', 640, 360, false );

Proportional scaling preserves the image’s aspect ratio, so its resulting dimensions may not fill a fixed card frame. A hard crop fills the frame but cuts off parts of the source. Preview representative images in the real layout before settling on a crop, especially where faces, text, or logos need to stay visible.

WordPress has built-in image size names including thumbnail, medium, medium_large, large, full, and post-thumbnail. Use a custom name when the built-in sizes do not fit the layout, and use the same name when registering and requesting it.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Request the size in the page template

In the loop that renders pages, request the registered size by name:

the_post_thumbnail( 'page-card' );

For example, a classic theme template can display each page’s featured image like this:

if ( have_posts() ) {
    while ( have_posts() ) {
        the_post();
        the_post_thumbnail( 'page-card' );
        the_title( '<h2>', '</h2>' );
    }
}

This function outputs the image for the current post in the loop. If a page has no featured image, it will not output one; add a fallback separately if the design requires a placeholder. Block themes and page builders may use different template controls, but the key requirement remains that the displayed image uses the intended registered size.

Assign a featured image to a page

  1. Open the page in the WordPress editor.
  2. In the editor sidebar, find the Featured Image control. If it is missing, confirm the theme has post-thumbnail support and that the page post type is supported.
  3. Select an existing Media Library image or upload one, then set it as the featured image.
  4. Update the page and check the relevant archive, card, or template to confirm the image and crop look right.

In some editor layouts, the sidebar may be hidden or the control may be unavailable because of theme or post-type configuration. Check the editor’s available panels and the active theme’s documentation before changing code or installing another plugin.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Regenerate image sizes for existing uploads

Registering a new size affects image processing for new uploads. It does not create that derivative for images already in the Media Library. After adding or changing a size, regenerate the existing files with WP-CLI or an admin plugin.

WP-CLI

Run this from the WordPress installation directory in an environment where WP-CLI is configured:

wp media regenerate

Review the command’s options in your installed WP-CLI version if you need to limit the operation rather than process the library broadly. Back up the site’s media files before a large regeneration job, and allow enough time and storage for it to finish.

Admin plugins

Simple Image Sizes describes controls for creating custom sizes and choosing which sizes to regenerate under Settings → Media; its plugin listing specifies PHP 8. reGenerate Thumbnails Advanced describes selective rebuilding, including featured images. Check each plugin’s current compatibility with your WordPress, PHP, and theme setup before using it, and back up media before bulk processing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Choose the method that fits your access

Method Access needed Useful when Considerations
Theme code and template Ability to edit or maintain theme code You need a stable named size that matches the site’s layout The size must be registered and requested consistently; changes do not rebuild existing files.
WP-CLI regeneration Shell or hosting access with WP-CLI available You want to regenerate existing derivatives from the site environment Bulk work can take time; check command options and back up media first.
Admin plugin WordPress administration access You need a dashboard interface or selective regeneration controls Compatibility depends on the plugin, WordPress, PHP, and theme versions; verify before a large job.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Troubleshooting common problems

The Featured Image control is missing

  • Confirm the active theme calls add_theme_support( 'post-thumbnails' ) during theme setup.
  • If support is scoped, confirm the page post type is included.
  • Check whether the editor sidebar or relevant panel is hidden, and consult the theme or page-builder documentation.

The displayed image has the wrong dimensions or crop

  • Confirm the template requests the intended registered name, such as page-card, rather than a different built-in size.
  • Check that the crop argument matches the layout: proportional scaling preserves the full image, while hard cropping fills a frame and removes part of the source.
  • Verify the rendered component’s actual aspect ratio before choosing dimensions; a theme or page builder may define its own image behavior.

A new size does not appear for older images

Existing uploads need regeneration after a size is registered or changed. Run wp media regenerate or use a compatible plugin to create the missing derivatives.

The page has no image

Registering a size does not assign a featured image. Set one in the page editor, or add template fallback behavior if the design should show an image when none is assigned.

Or skip the browser setup

If what you need is a screenshot thumbnail of a live page—not a WordPress-generated derivative of a featured image—ScreenshotNeo can return an image from one API request. It does not assign featured images or regenerate Media Library sizes.

curl -G "https://api.screenshotneo.com/v1/shot" -d access_key=YOUR_API_KEY --data-urlencode url=https://example.com -o shot.webp

See the ScreenshotNeo API documentation for request options. It can remove cookie and consent banners, newsletter popups, and chat widgets before capture; bot checks, blank pages, and failed loads are not billed. Its 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.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Sign up free for 1,000 screenshots a month, with no card.

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.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
PC Slower Than It Used to Be?Free scan - under a minute
Outdated Drivers Are Slowing You DownFree scan - exact matches

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.