ScreenshotNeo

BlogHow-to

How to Optimize Images in WordPress

Reduce WordPress image weight without sacrificing appearance. Learn sizing, WebP, plugins, compatibility checks, and how to verify the result.

By the ScreenshotNeo team4 October 20269 min read

To optimize images in WordPress, start with dimensions close to how each image is displayed, then choose an appropriate format and compression level. WordPress creates registered image sizes when you upload media; WebP can reduce file size, and plugins can help resize, compress, or convert older library items. Check the result on the actual page and host: image quality, format delivery, and server support all matter.

1. Find the images that need optimization

Begin with the rendered page, not a blanket compression setting. Identify which images are large, where they appear, and the size at which visitors see them. A source image much larger than its display area may carry unnecessary bytes, but a source that is too small can look soft on high-density screens or when enlarged.

  1. List the main image placements: featured images, content images, product photos, logos, and backgrounds.
  2. Check the rendered dimensions and the image file actually delivered by the page. Themes and registered image sizes affect which variant WordPress generates and uses.
  3. Resize originals or configure an optimization workflow to create appropriate dimensions for those placements.
  4. Compare the result at the displayed size, including any retina or high-density display use case that matters to your site.

WordPress generates image sub-sizes on upload according to registered sizes, and themes can register additional sizes. By default, generated sub-sizes use the original image format. The available generated formats and sizes depend on WordPress behavior and the image-processing support on the server. See the WordPress Theme Handbook: Images.

2. Choose a format and compression approach

Use the format that preserves the image’s important detail at a reasonable file size. JPEG, PNG, WebP, and AVIF are relevant options in the cited plugin workflows; animated images such as GIFs may need separate consideration. Do not choose a format or quality number on the assumption that one setting suits every image. Review the result at the size visitors will see.

WordPress 5.8 introduced WebP support. The WordPress Performance team described generating WebP versions of uploaded JPEGs and their sub-sizes while retaining originals when the server supports the required capability. Its March 28, 2022 post reported that generated WebP images were “almost always smaller” than JPEGs, with an average reduction of about 30% at the same visual quality. That is a project-reported average from 2022, not a guarantee for a particular image, encoder, server, or site. Read the WordPress Performance team’s post on enabling WebP by default.

Compression can be lossy or lossless, and available controls vary by workflow. Lossy compression can reduce size further but may introduce visible artifacts; lossless compression preserves the decoded image data but may produce a smaller reduction. Inspect photos, fine text, edges, transparency, and gradients separately. Keep an original backup before bulk or destructive conversion.

3. Decide between WordPress, a plugin, or a service

Use native WordPress WebP behavior if it meets your needs for new uploads and your host supports the required processing capability. Consider a plugin when you need configurable compression, explicit maximum dimensions, AVIF conversion, or bulk processing of existing media. Before installing one, check its current documentation and listing for these details:

  • Formats: Which of JPEG, PNG, WebP, AVIF, and animated formats are accepted and produced?
  • Workflow: Does it optimize new uploads, individual older files, bulk library items, or some combination?
  • Dimensions: Can it resize oversized sources, and what maximum width or height does it use?
  • Compression: Are lossy and lossless options available? Can you review output before replacing or serving it?
  • Processing location: Are files processed on your server or sent to an external service? Account for that in privacy and operational decisions.
  • Compatibility: Does it require GD or Imagick support, a specific format capability, or web-server rewrite configuration?

These are feature checks, not independent quality rankings. For example, the Elementor Image Optimization listing describes JPEG, PNG, WebP, AVIF, and GIF support, automatic upload processing, individual and bulk processing, and a configurable maximum width that lists 1920 pixels as the default. The listing says processing uses a third-party service operated by Elementor. The WebP Image Optimization listing describes WebP or AVIF conversion, resizing, compression controls, and a requirement for GD with WebP support. Plugin features can change; verify current requirements before relying on them.

4. Optimize new uploads and existing media

For new uploads

  1. Prepare an image at a suitable source dimension for its expected placements.
  2. Upload it through the workflow you selected: native WordPress processing or a plugin.
  3. Confirm WordPress generated the expected sub-sizes and that the page requests an appropriate one.
  4. Check the delivered format and inspect visual quality on a representative page.

For existing media

  1. Back up the media library and database, and check whether the tool keeps originals or can restore them.
  2. Start with a representative sample: photographs, transparent graphics, and any image types important to your site.
  3. Run individual or bulk processing according to the plugin’s documented workflow and server limits.
  4. Review the converted files and pages before processing the remainder or changing delivery rules site-wide.

Do not assume that conversion alone makes the browser receive the converted file. Some plugins create alternate files and rely on server or plugin delivery rules to select them. The Images to WebP listing documents conversion and delivery requirements and notes that some combined Nginx/Apache setups may require host-specific handling of rewrite behavior.

5. Verify format delivery and appearance

Check a representative page after conversion, both logged in and as a normal visitor if plugin behavior differs by session. Confirm the browser receives the intended image variant and format, the image renders at the expected dimensions, and no rewrite or cache rule serves a missing or stale file. Test more than one image type and viewport.

  • Inspect photographs for banding, smearing, or block artifacts.
  • Inspect logos and illustrations for edge quality and transparency.
  • Confirm alternate sizes and responsive image behavior still work in the theme.
  • Check that cached pages and image URLs update after conversion.
  • Test on the production-like host, since local GD/Imagick capabilities and rewrite behavior may differ.

6. Troubleshooting

Symptom Likely cause What to check or change
No WebP or AVIF output appears The server image library lacks support for the requested format, or the plugin’s processing requirement is unmet. Check the host’s GD or Imagick capabilities and the plugin’s stated requirements. The WebP Image Optimization listing specifically requires GD with WebP support.
Converted files exist, but pages still serve the original Delivery rules, rewrite configuration, caches, or plugin settings are not selecting the alternate file. Follow the plugin’s delivery setup, clear relevant caches, inspect the actual response, and ask the host about its web-server configuration. Some Nginx/Apache combinations need host-specific rewrite handling.
Images look blurry or damaged The source was resized too small, compression is too aggressive, or the format is unsuitable for the image’s detail. Compare at display size, increase dimensions or quality, and review the affected image type before applying settings in bulk.
Transparent artwork has a solid background The conversion path or chosen output format did not preserve transparency as expected. Use a format and plugin workflow that supports transparency, then inspect the converted asset before replacing the original.
Bulk processing stops partway through Processing may exceed the host’s execution, memory, or request limits, or the tool may require a resumable batch workflow. Check plugin guidance and host limits, process smaller batches if supported, and confirm which files completed before retrying.
Images break after enabling conversion Generated file paths or rewrite rules may not match the server setup, or a cached page may refer to a missing variant. Disable or roll back the delivery change, restore from backup if needed, inspect file paths and server rules, then retest on a small sample.
New uploads work but older images do not The plugin may optimize uploads automatically but require a separate bulk or individual action for existing media. Check the documented workflow and run the existing-library process, starting with a backed-up sample.

7. Performance, reliability, and cost considerations

Image optimization can reduce the bytes a page transfers, but the result depends on the source files, output quality, generated variants, and which variant the page delivers. The WordPress Performance team’s approximately 30% average WebP reduction was scoped to its generated WebP images versus JPEG at similar visual quality and was published in 2022; do not treat it as a prediction for your site. Measure representative pages before and after with the same conditions.

Reliability depends on retaining originals or having a tested backup, processing within host limits, and making sure delivery rules work with the actual web server and cache. A third-party processing service also means files are handled outside your WordPress server; review its current terms and workflow. Plugin pricing and service limits are not established by the sources here, so check the current listing and provider documentation.

8. Capture a page screenshot to review the rendered result

A screenshot can help you compare how a representative page looks after an image change, but it does not replace checking file size, format, or browser delivery. For a quick manual review, open the page at the viewport you care about and use your browser’s screenshot or developer tools. For repeatable captures, a browser automation script can save a full-page screenshot. The following runnable example uses Playwright with Node.js.

npm install playwright
npx playwright install chromium
// save as capture.mjs
import { chromium } from 'playwright';

const browser = await chromium.launch({ headless: true });
const page = await browser.newPage({ viewport: { width: 1440, height: 1000 } });
try {
  await page.goto('https://example.com/your-wordpress-page/', {
    waitUntil: 'networkidle',
    timeout: 60000,
  });
  await page.screenshot({ path: 'wordpress-page.png', fullPage: true });
} finally {
  await browser.close();
}

Replace the example URL with a page you are authorized to access. If the site keeps analytics, ads, or polling requests active, waiting for network idle may take too long; use a suitable selector or a short fixed delay instead. This captures the page for visual comparison; inspect network responses separately to verify delivered image formats and dimensions.

Or skip the browser setup

ScreenshotNeo is a website screenshot API and MCP server for developers. One GET request captures a URL as PNG, JPEG, WebP, or PDF. Its capture flow accepts cookie or consent banners like a visitor and removes 60+ known consent platforms, newsletter popups, and chat widgets; each step can be turned off. Bot checks, blank pages, timeouts, failed loads, and cache hits cost nothing, with the page verdict and billing status in response headers. AI agents can use its MCP server tools: take_screenshot, get_page_info, and capture_pdf.

For a rendered-page review, save a WebP screenshot with cURL:

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

The same request in Python:

import requests

r = requests.get(
    "https://api.screenshotneo.com/v1/shot",
    params={"access_key": "YOUR_API_KEY", "url": "https://example.com/your-wordpress-page/"},
    timeout=90,
)
r.raise_for_status()
open("wordpress-page.webp", "wb").write(r.content)

And in Node.js:

const q = new URLSearchParams({
  access_key: 'YOUR_API_KEY',
  url: 'https://example.com/your-wordpress-page/',
});
const res = await fetch(`https://api.screenshotneo.com/v1/shot?${q}`);
if (!res.ok) throw new Error(`Screenshot request failed: ${res.status}`);
await import('node:fs/promises').then(fs => fs.writeFile('wordpress-page.webp', Buffer.from(await res.arrayBuffer())));

See the ScreenshotNeo API documentation for request options. Cookie banners, popups, and chat widgets are removed before the shot; bot checks, blank pages, and failed loads are never billed; the MCP server lets AI agents take screenshots. The Free plan includes 1,000 shots a month with no card, and paid plans start at $5 for 3,000. Sign up for 1,000 free screenshots a month with no card.

FAQ

Does WordPress automatically make every image WebP?

WordPress supports WebP, but generated formats depend on the upload format, WordPress behavior, and server image capabilities. Check what your host generates and what the page delivers.

Should I convert every image in the media library?

Only after checking compatibility, backups, and output quality on a representative sample. Existing images may require a separate bulk workflow from new uploads.

Is a plugin required?

No. Native WordPress behavior may cover WebP generation needs. A plugin can add controls or workflows such as resizing, alternate formats, and bulk processing, depending on its current features.

Will smaller image files guarantee a faster site?

No single reduction guarantees a page-speed result. The delivered image variants, page composition, caching, and other resources affect the outcome; measure the page you care about.