Custom Image Sizes
Add custom image sizes beyond WordPress defaults. Create exact dimensions for hero banners, product thumbnails, or any layout requirement — no code needed.
Use Cases
- Create 450×300px hero images to match your theme’s exact design specs
- Generate 1200×630px images for perfect Facebook and Twitter share previews
- Add breakpoint-specific sizes for optimal responsive image performance
How It Works
- Add a custom size with name and dimensions
- Choose whether to crop or scale
- New uploads automatically generate this size
- Regenerate thumbnails for existing images
Where to Find It
Configure in Switchboard → Media → Custom Image Sizes. The settings panel shows:
- WordPress Default Sizes — Thumbnail, Medium, Large (managed in Settings → Media)
- Theme/Plugin Sizes — Registered by your theme or plugins (read-only)
- Your Custom Sizes — Sizes you create (editable)
Adding a New Size
- Enter a Size Name (lowercase, underscores, e.g.,
hero_banner) - Set Width in pixels
- Set Height in pixels
- Choose whether to Crop to exact dimensions
- Click Add Image Size
Size Name Format
Names must use:
- Lowercase letters
- Numbers
- Underscores
Examples: product_thumb, hero_image, gallery_large, card_300x200
Crop vs Scale
| Mode | What Happens | Best For |
|---|---|---|
| Crop OFF | Image fits within dimensions, aspect ratio preserved | Flexible layouts |
| Crop ON | Image fills exact dimensions, edges may be cut | Fixed-size containers |
Crop Example
Original image: 1600×900 (16:9 ratio) Custom size: 400×400 (1:1 square)
- Without crop: 400×225 (maintains ratio, fits within 400×400)
- With crop: 400×400 (exact square, sides trimmed)
Proportional Sizing
Set one dimension to 0 for proportional scaling:
| Width | Height | Result |
|---|---|---|
| 800 | 0 | 800px wide, height proportional |
| 0 | 600 | 600px tall, width proportional |
| 800 | 600 | Fits within 800×600 (or crops to exact) |
Common Size Presets
Here are useful sizes for common needs:
| Name | Dimensions | Crop | Use Case |
|---|---|---|---|
og_image | 1200×630 | Yes | Open Graph/social sharing |
hero_banner | 1920×600 | Yes | Full-width hero sections |
card_thumb | 400×300 | Yes | Blog post cards |
gallery_square | 600×600 | Yes | Instagram-style galleries |
product_large | 800×0 | No | Product detail images |
Using Custom Sizes
Once created, custom sizes appear in:
- Block Editor: Image block size selector
- Classic Editor: Media insert size dropdown
- Theme code:
the_post_thumbnail('your_size_name') - PHP functions:
wp_get_attachment_image($id, 'your_size_name')
Applying to Existing Images
New sizes only affect future uploads. For existing images:
- Add your custom sizes here
- Go to the Regenerate Thumbnails module
- Run the regeneration process
This creates the new sizes for all existing images.
Editing and Deleting
Edit a size: Click Edit, modify values, click Add (same name updates existing)
Delete a size: Click Delete. Existing thumbnails at that size remain on disk but new uploads won’t create them.
FAQ
Why aren’t my sizes showing in the block editor?
Sizes with very small dimensions or unusual aspect ratios may be filtered out by the editor. Try using sizes with both dimensions above 100px.Can I modify WordPress default sizes?
Thumbnail, Medium, and Large are managed in Settings → Media. This module is for adding new sizes beyond those defaults.Do I need to regenerate thumbnails?
For new uploads: No, sizes are generated automatically. For existing images: Yes, use the Regenerate Thumbnails module.What happens if I delete a custom size?
- Future uploads won’t create that size
- Existing thumbnails at that size remain until you delete them
- References to that size will fall back to the nearest available size
Can I have unlimited custom sizes?
Technically yes, but each size increases storage usage and upload time. Add only sizes you actually use. 5-10 custom sizes is reasonable.Are my sizes kept if I deactivate the plugin?
The size definitions are stored in your database. If you deactivate the module, sizes won’t be generated for new uploads, but existing thumbnails and the settings remain.Get access to all 147 modules with a single license