All Articles
PerformanceSEOImages

How to Convert WordPress Images to WebP (Free, No API Key)

How to Convert WordPress Images to WebP (Free, No API Key)

Bottom line: most WordPress WebP plugins charge a monthly fee or require an external API key, but PHP's own GD and Imagick libraries — available on virtually every host — can convert images to WebP and AVIF locally for free. Erdo Image Optimizer uses exactly that approach, with no account or quota involved.

Why WebP Matters for Your WordPress Site

Images typically account for 50–80% of a web page's total weight. If your site still serves JPEG and PNG files, you're leaving significant performance gains on the table.

WebP is Google's open image format. At the same quality, a WebP file is roughly 25–35% smaller than JPEG and up to 50% smaller than PNG. AVIF — the newer format — goes even further, often cutting file size by 50% compared to JPEG.

Smaller images mean:

  • Faster page load times
  • Better Core Web Vitals scores (especially LCP)
  • Lower bounce rates
  • Higher Google search rankings

The problem? Most WordPress image optimization plugins either charge a monthly fee, require you to sign up for an external API, or impose strict conversion limits on free plans.

The Usual Suspects — and Their Limits

Before we get to a free solution, let's be honest about what the common options actually offer:

Smush (free tier): Compresses images on their servers. Free plan has a 5MB per-image limit and no WebP conversion unless you upgrade to Pro ($7.99/month).

ShortPixel: Excellent quality, but the free plan gives you 100 credits per month. A site with thousands of images will burn through that fast.

EWWW Image Optimizer: Good plugin, but WebP serving requires configuring Nginx or Apache rewrite rules — confusing for most users.

Imagify: 20MB of free optimization per month. That's one or two images for some sites.

If you run a content-heavy site, a photography portfolio, or a WooCommerce store with product images, these limits become problems quickly.

A Different Approach: Local Conversion

There's no reason WebP conversion has to happen on someone else's server. PHP's built-in GD and Imagick libraries — available on virtually every shared host — can handle WebP and AVIF conversion natively.

Running conversion locally means:

  • No API keys
  • No monthly quotas
  • No sending your images to third-party servers
  • No latency from round-trips to external services

This is exactly how Erdo Image Optimizer works. It uses your server's own image libraries to convert, compress, and serve modern formats — all within your WordPress installation.

How to Install Erdo Image Optimizer

  1. In your WordPress admin, go to Plugins → Add New
  2. Search for "erdo image optimizer"
  3. Click Install Now, then Activate

That's it. No API key screen, no account creation, no upsell popup on activation.

What Happens Next

Open Image Optimizer in the admin menu. A first-run setup tests your server with a real WebP and AVIF test encode (so it knows what your host can actually produce), detects a CDN and your SEO plugin, recommends settings and builds an index of where every image is used.

Converting the Existing Library

Start the conversion from the Overview and it runs in the background. Copies are saved next to each original and each generated size: team.jpg gets team.jpg.webp and, if your server can encode it, team.jpg.avif. A copy is kept only when it is smaller than the original, and the original file is never modified or deleted. "Remove copies" undoes it for any image.

Prefer the command line? WP-CLI shows what would happen first:

wp erdo convert --dry-run
wp erdo convert --limit=500
wp erdo stats

Automatic Conversion on Upload

New uploads get their copies automatically, so you don't need to rerun anything after adding content.

How Serving Works

There are two delivery methods:

  • <picture> tags (default). The plugin rewrites image markup in your pages, so every browser gets a URL it can use and caches never mix formats up. This works behind Cloudflare, any other CDN and any page cache.
  • .htaccess rewrite (Apache and LiteSpeed). The same URL serves WebP or AVIF depending on the browser, with a Vary: Accept header. Use it only if your CDN respects that header. On nginx, copy the ready-made snippet from Settings → Delivery into your server block.

A simplified example of the <picture> output:

<picture>
  <source type="image/avif" srcset="/wp-content/uploads/2026/05/team.jpg.avif">
  <source type="image/webp" srcset="/wp-content/uploads/2026/05/team.jpg.webp">
  <img src="/wp-content/uploads/2026/05/team.jpg" alt="Our team in the Izmir office" width="1200" height="800">
</picture>

Chrome, Edge, Firefox and Safari 16+ pick AVIF, older Safari picks WebP, and anything else falls back to the original JPEG.

The Image SEO Score

Format conversion is only part of image SEO. Version 3 of the plugin gives every image a score from 0 to 100: alt text (40 points), file name (20), format (10), file size (10), dimensions (5) and context (15). It flags:

  1. Missing or weak alt text — file-name-like text, "image of…" phrases, keyword lists and overly long descriptions lose points
  2. Camera file names — IMG_4821.jpg, DSC_0042, Screenshot, WhatsApp Image
  3. No WebP/AVIF copy and oversized files
  4. Images that are not on any indexable page (noindex settings from Yoast SEO and Rank Math are respected)

Filter the library by issue, export the report as CSV, or pull it from WP-CLI:

wp erdo audit --status=red --format=csv > weak-images.csv

Camera names can be fixed in bulk: renaming moves every size and copy, updates links in your content and page builder data, and redirects the old URL with a 301 so Google Images traffic isn't lost. Every rename can be undone.

Alt Text Suggestions With AI (Optional)

On WordPress 7.0 and newer you can connect your own Anthropic, Google or OpenAI account under Settings → Connectors. The plugin then suggests alt text, a file name, a title and a caption from the image together with the page it appears on and its focus keyword. Suggestions wait in an "AI Suggestions" tab until you accept, edit or reject them, and bulk runs show an estimated cost first (the plugin's own estimate is roughly $0.15–$0.40 per 1,000 images).

This is the only part that talks to an outside service, and it is off unless you connect a provider. For writing alt text that actually helps, see our image SEO and alt text guide.

What About HEIC and Lazy Loading?

Neither is part of the plugin. Copies are created from JPEG, PNG and GIF only, so set iPhones to Settings → Camera → Formats → Most Compatible or export photos as JPEG before uploading. Lazy loading is already handled by WordPress core, which adds loading="lazy" and leaves out the image most likely to be the LCP element; doubling it with a plugin is how hero images end up lazy-loaded (see the Core Web Vitals image checklist).

Real-World Performance Impact

On a typical WordPress site with 200 product images (JPEG, average 180KB):

Format Average file size Total for 200 images
Original JPEG 180 KB 36 MB
WebP ~115 KB ~23 MB
AVIF ~85 KB ~17 MB

That's a 35–53% reduction in image payload — which translates directly to faster load times for every visitor. If you're deciding whether to also enable AVIF, see our full WebP vs AVIF comparison for the tradeoffs.

Compatibility

The plugin works with:

  • Any host with PHP's GD or Imagick library (AVIF needs a build with AVIF support; the setup test tells you)
  • Apache, LiteSpeed and nginx
  • Cloudflare and other CDNs through <picture> delivery
  • Gutenberg, Elementor and other page builders, ACF fields and WooCommerce product galleries (all read by the usage index)
  • WordPress 6.5 and above, PHP 7.4 and above

Wrapping Up

If you're running a WordPress site and you're not serving WebP, you're making your visitors download unnecessarily large files and leaving performance points on the table. The good news is fixing this doesn't require a paid subscription — your server already has everything it needs.

Download Erdo Image Optimizer free from WordPress.org and run your first bulk conversion in under five minutes.

Frequently asked questions

Do I need an API key to convert images to WebP?
No. Erdo Image Optimizer uses your server's own PHP GD or Imagick library to convert images locally — no API key, account, or monthly quota required.
What's the difference between WebP and AVIF?
WebP is roughly 25–35% smaller than JPEG at the same quality. AVIF goes further, often cutting file size by 50% compared to JPEG, but has slightly lower browser support. The plugin serves AVIF to supporting browsers and falls back to WebP automatically.
Will visitors on older browsers still see my images?
Yes. The plugin uses <picture> elements with multiple <source> tags, so browsers that don't support WebP or AVIF automatically fall back to the original JPEG or PNG.
Does it work with iPhone (HEIC) photos?
No. Copies are created from JPEG, PNG and GIF. Set the iPhone camera to "Most Compatible" or export photos as JPEG before uploading, and the plugin will create WebP/AVIF copies from those.