Title: Petro SEO Images to WebP
Author: diegopetroncari
Published: <strong>May 16, 2026</strong>
Last modified: May 16, 2026

---

Search plugins

![](https://ps.w.org/petro-seo-images-to-webp/assets/banner-772x250.png?rev=3533935)

![](https://ps.w.org/petro-seo-images-to-webp/assets/icon-256x256.png?rev=3533935)

# Petro SEO Images to WebP

 By [diegopetroncari](https://profiles.wordpress.org/diegopetroncari/)

[Download](https://downloads.wordpress.org/plugin/petro-seo-images-to-webp.1.1.2.zip)

 * [Details](https://wordpress.org/plugins/petro-seo-images-to-webp/#description)
 * [Reviews](https://wordpress.org/plugins/petro-seo-images-to-webp/#reviews)
 *  [Installation](https://wordpress.org/plugins/petro-seo-images-to-webp/#installation)
 * [Development](https://wordpress.org/plugins/petro-seo-images-to-webp/#developers)

 [Support](https://wordpress.org/support/plugin/petro-seo-images-to-webp/)

## Description

**Petro SEO Images to WebP** converts your existing JPEG and PNG attachments to 
WebP in bulk, then serves them on the front-end through the standard `<picture>`
element with a full responsive `srcset`. The original files stay untouched on disk,
so reverting is as simple as flipping a switch.

Designed to be small, dependency-free and predictable. No external services, no 
images uploaded anywhere, no opaque queue.

#### What it does

 * Converts every registered image size (full + thumbnails) to `.webp` next to the
   original (e.g. `photo.jpg`  `photo.jpg.webp`).
 * Wraps `<img>` tags from `wp_get_attachment_image()` and `the_content` in `<picture
   ><source type="image/webp">…</picture>`, preserving full `srcset` and `sizes`.
 * Skips images automatically if a previous run failed because of filesystem permissions,
   so you can retry on demand without reprocessing the whole library.
 * Ramps the WebP quality down (75  60  45  40) when the encoded file ends up larger
   than the original, so you never ship a “WebP” that is heavier than the JPEG.
 * Idempotent: re-running the bulk job only touches new or updated images.

#### What it does NOT do

 * It does not delete or modify your original JPG/PNG files.
 * It does not require Imagick or a specific image library beyond what WordPress
   already uses (`wp_get_image_editor()`).
 * It does not phone home, register endpoints, or load remote scripts.

#### Privacy

The plugin processes images locally using WordPress’s built-in image editor. No 
data is sent to third-party services.

## Screenshots

[⌊Admin page under Media → Petro SEO Images to WebP — settings, bulk-conversion 
counters, and Convert / Revert / Retry controls.⌉⌊Admin page under Media → Petro
SEO Images to WebP — settings, bulk-conversion counters, and Convert / Revert / 
Retry controls.⌉[

Admin page under **Media  Petro SEO Images to WebP** — settings, bulk-conversion
counters, and Convert / Revert / Retry controls.

## Installation

 1. Upload the `petro-seo-images-to-webp` folder to `/wp-content/plugins/`, or install
    via the Plugins screen.
 2. Activate the plugin through the **Plugins** screen.
 3. Go to **Media  Petro SEO Images to WebP**.
 4. Click **Convert all** to process the existing library.
 5. Make sure **Serve WebP** is enabled to wrap front-end images in `<picture>`.

## FAQ

### Will this overwrite my original images?

No. Originals stay on disk. The plugin writes a sibling file with the `.webp` extension(
e.g. `photo.jpg` and `photo.jpg.webp`).

### How can I undo the conversion?

On **Media  Petro SEO Images to WebP**, click **Revert all**. Every generated `.
webp` file is removed and the tracking metadata is cleared.

### Some images were skipped. Why?

The most common cause is a write-permission issue on the uploads folder. Fix the
directory permissions (e.g. `chown www-data:www-data` on Linux) and click **Retry
skipped** to reprocess only those.

### Does it work with responsive images / srcset?

Yes. The `<source>` element inside `<picture>` carries the full `srcset` and `sizes`,
with each URL pointing to its `.webp` counterpart. URLs whose `.webp` is missing
on disk are silently dropped from the WebP `srcset` so the browser falls back to
the original `<img>`.

### Can I serve `.webp` files without using the “ tag?

If you uncheck **Serve WebP** the files stay on disk but the plugin will not wrap
your `<img>` markup. You can then serve them yourself (e.g. via Nginx Accept negotiation
or a CDN rule).

### What if the WebP version ends up larger than the original?

The plugin retries with progressively lower quality (down to 40). If even at the
lowest quality the WebP is still bigger than the source, it logs a diagnostic line
and uses what it has — most browsers will still benefit from the format.

## Reviews

There are no reviews for this plugin.

## Contributors & Developers

“Petro SEO Images to WebP” is open source software. The following people have contributed
to this plugin.

Contributors

 *   [ diegopetroncari ](https://profiles.wordpress.org/diegopetroncari/)

[Translate “Petro SEO Images to WebP” into your language.](https://translate.wordpress.org/projects/wp-plugins/petro-seo-images-to-webp)

### Interested in development?

[Browse the code](https://plugins.trac.wordpress.org/browser/petro-seo-images-to-webp/),
check out the [SVN repository](https://plugins.svn.wordpress.org/petro-seo-images-to-webp/),
or subscribe to the [development log](https://plugins.trac.wordpress.org/log/petro-seo-images-to-webp/)
by [RSS](https://plugins.trac.wordpress.org/log/petro-seo-images-to-webp/?limit=100&mode=stop_on_copy&format=rss).

## Changelog

#### 1.1.2

 * Admin UI polish: ASCII-art header on **Media  Petro SEO Images to WebP** and 
   a discreet author credit linking to the wordpress.org profile. No functional 
   changes — purely cosmetic.

#### 1.1.1

 * Plugin Check pass: drop empty `.gitkeep` placeholders from `includes/` and `assets/`(
   they no longer make it into the release zip).
 * Replace direct `is_writable()` / `chmod()` filesystem calls with `wp_is_writable()`;
   the opportunistic `chmod 0755` self-heal is gone — read-only directories now 
   surface a clean permission error instead of being silently patched.
 * Drop the `load_plugin_textdomain()` call; wordpress.org auto-loads translations
   since WP 4.6.
 * Wrap `uninstall.php` logic in a `psitw_uninstall()` function so locals stay out
   of the file scope.
 * Annotate the unavoidable direct `$wpdb` queries (uninstall sweep, namespace migration,
   skipped-meta cleanup) and `meta_query` / `post__not_in` calls with justified `
   phpcs:ignore` comments.

#### 1.1.0

 * Rebrand to **Petro SEO Images to WebP**: new plugin slug `petro-seo-images-to-
   webp`, new internal prefix `Psitw_*` / `psitw_*` (5-letter prefix per WordPress
   plugin guidelines). A one-time auto-migration on first load forwards every legacy
   storage key (`siw_*` and `plugin_images_*`) into the new namespace, so existing
   conversion state is preserved.
 * The admin page moved to **Media  Petro SEO Images to WebP**.

#### 1.0.4

 * Rename internal class prefix and storage keys to `siw_*` for unique namespacing—
   a one-time auto-migration runs on first load and copies legacy data forward.
 * Replace `@unlink` with `wp_delete_file()` and add `Plugin URI`, `Author URI`,`
   Requires at least` headers for wordpress.org compliance.
 * Trim readme tags to 5, bump tested-up-to, exclude dev-only docs from the release
   zip.

#### 1.0.3

 * Skip attachments that fail because of filesystem permissions and offer a one-
   click retry flow.
 * Ramp quality down when the resulting WebP is larger than the original.
 * Keep the bulk loop alive when an entire batch fails by excluding failed IDs.
 * Preserve full responsive `srcset` inside the generated `<picture><source>`.

#### 1.0.0

 * Initial public release.

## Meta

 *  Version **1.1.2**
 *  Last updated **2 months ago**
 *  Active installations **Fewer than 10**
 *  WordPress version ** 5.8 or higher **
 *  Tested up to **6.9.5**
 *  PHP version ** 7.1 or higher **
 * Tags
 * [images](https://wordpress.org/plugins/tags/images/)[performance](https://wordpress.org/plugins/tags/performance/)
   [picture](https://wordpress.org/plugins/tags/picture/)[seo](https://wordpress.org/plugins/tags/seo/)
   [webp](https://wordpress.org/plugins/tags/webp/)
 *  [Advanced View](https://wordpress.org/plugins/petro-seo-images-to-webp/advanced/)

## Ratings

No reviews have been submitted yet.

[Your review](https://wordpress.org/support/plugin/petro-seo-images-to-webp/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/petro-seo-images-to-webp/reviews/)

## Contributors

 *   [ diegopetroncari ](https://profiles.wordpress.org/diegopetroncari/)

## Support

Got something to say? Need help?

 [View support forum](https://wordpress.org/support/plugin/petro-seo-images-to-webp/)