plugin-icon

SEV Rewrite-Free WebP for W3TC

Replaces image URLs with WebP versions when supported and available through W3 Total Cache ImageService.
Version
2.0.0
Last updated
Jul 20, 2026

SEV Rewrite-Free WebP for W3TC is a lightweight companion plugin for W3 Total Cache that automatically serves WebP images to browsers that support them.

Unlike traditional WebP delivery methods, this plugin does not rely on Apache or Nginx rewrite rules. No changes to .htaccess, mod_rewrite, or web server configuration are required. Instead, it rewrites image URLs directly in the generated HTML before the page is sent to the visitor.

This makes the plugin particularly useful on managed hosting environments, including many Plesk installations, where configuring or relying on web server rewrite rules is difficult, restricted, or simply not practical. If W3 Total Cache ImageService has already generated a WebP version of an image, this plugin serves it without requiring any server-side rewrite configuration.

This is an independent, unofficial add-on and is not affiliated with, endorsed by, or sponsored by BoldGrid / W3 EDGE, the makers of W3 Total Cache. “W3 Total Cache” is a trademark of its respective owner and is used here only to describe compatibility.

Features

  • No Apache or Nginx rewrite rules required.
  • No .htaccess modifications.
  • Automatically detects WebP support via the browser’s Accept header.
  • Rewrites image URLs only when a corresponding WebP image exists.
  • Supports src, srcset, data-src, and data-srcset attributes.
  • Sends a Vary: Accept header for correct browser, CDN, and proxy caching.
  • Extends the W3 Total Cache page cache key so WebP and non-WebP pages are cached separately.
  • Lightweight and requires no configuration.

How it works

  1. A visitor requests a page.
  2. The plugin checks the HTTP Accept header to determine whether the browser supports WebP.
  3. It scans the post content for image URLs (src, srcset, data-src, and data-srcset).
  4. For each image, it checks whether W3 Total Cache ImageService has already generated a WebP version.
  5. If a WebP image exists, the corresponding URL in the generated HTML is replaced with the .webp URL.
  6. A Vary: Accept response header is added so browsers, CDNs, and reverse proxies cache WebP and non-WebP responses separately.
  7. The W3 Total Cache page cache key is extended with :webp or :no-webp, ensuring W3 Total Cache stores separate cached pages for browsers with and without WebP support.

Requirements

  • W3 Total Cache must be installed and active.
  • Images must have been converted using Media W3TC Image Service.

Limitations

This plugin does not convert images to WebP. Image conversion is handled entirely by W3 Total Cache ImageService. If no WebP version exists for an image, the original image URL remains unchanged.

Freeon paid plans
Tested up to
WordPress 7.0.2
This plugin is available for download for your site.