---
title: Image Optimization
description: Serve smaller WebP and AVIF images in WordPress with Powered Cache Premium Image Optimization. Learn how delivery works, format choices and exclusions.
url: "https://poweredcache.com/docs/image-optimization/"
updated: "2026-12-02"
category: Media
---

# Image Optimization

Image Optimization serves your images through the Powered Cache image delivery service, which converts them to modern formats such as AVIF and WebP and resizes them to the size the page needs. Smaller images make pages load faster, especially on mobile. Your original files in the Media Library are never changed.

**Available in:** Powered Cache Premium, with an active license
**Where to find it:** Powered Cache → Media
**Requires:** a site that is publicly reachable on the internet.

## How image optimization works

Image Optimization works on the fly. There is no bulk process to run and nothing is stored in your Media Library:

1. When WordPress builds a page, Powered Cache rewrites image addresses to the delivery domain `img.poweredcache.net`. The new address contains your original image address and the size the page displays it at.
2. The first time a visitor's browser requests that address, the service fetches the original image from your site, optimizes it and keeps the result.
3. Later requests are answered from the service's cache.

Powered Cache rewrites images in post content, galleries, image and text widgets, featured images, responsive `srcset` versions and the rest of the page HTML. Images are resized to the width and height in the image tag, to the registered WordPress image size, or to your theme's content width, so a large upload is not sent to a small slot. Links that open the full-size image are routed through the service too.

Supported file types are JPG, JPEG, PNG, GIF, WebP, AVIF, SVG and BMP. The page also gets a DNS prefetch hint for `img.poweredcache.net`.

## Turn on image optimization

1. Make sure your Powered Cache Premium license is active. See [Activate your license](/docs/install-powered-cache-premium/#activate-license).
2. Go to **Powered Cache → Media**.
3. Turn on **Image Optimization**.
4. Leave **Image Format Preference** on *Automatic (AVIF when supported)*.
5. Click **Save Settings** and clear the cache, so cached pages are rebuilt with the new image addresses.
6. Open a page in a private browser window and check in your browser's developer tools that image requests go to `img.poweredcache.net`.

Image Optimization is off by default. With an active license, **Apply Recommended Settings** turns it on, except on local and development sites.

## Settings

### Image Optimization

Routes images through the delivery service. **Default: off.**

### Image Format Preference

Chooses the output format. **Default: Automatic (AVIF when supported).**

| Option | What visitors get | Choose it when |
| --- | --- | --- |
| **Automatic (AVIF when supported)** | AVIF for browsers that support it, otherwise another supported format. The delivery service decides per request. | Most sites. AVIF files are usually the smallest. |
| **Prefer WebP** | WebP. | You prefer WebP's look for your images, or you need the same format for every visitor. |

## Image Delivery panel and Purge Image Cache

The **Image Delivery** panel at the top of the Media screen shows whether the service is enabled, the delivery domain and the preferred format.

The service keeps optimized copies of your images. If you replace an image file but keep its file name, visitors can still get the old version. Click **Purge Image Cache** in the panel to ask the service to drop the stored copies of your site's images. They are optimized again on the next request. **Purge All Cache** (in the admin bar or under Tools) also sends this purge request. The purge needs an active license and is not available on multisite installations.

## Exclude images

There is no exclusion list on the settings screen. Some images are always left alone:

- file types other than the supported ones listed above, and image addresses without a file extension or ending in `.php`,
- images from some third-party services, such as Google Charts, Facebook, PayPal, Dropbox, Instagram, Wikipedia and Wikimedia,
- anything in the WordPress admin, the block editor, previews, and requests other than `GET`.

Images from other domains are optimized too, as long as the service can download them.

**For developers:** to keep specific images on your own server, return `true` from the `powered_cache_image_optimizer_skip_for_url` filter. It runs for every image address that would be rewritten. Add the code to a small custom plugin or your child theme's `functions.php`:

```
add_filter( 'powered_cache_image_optimizer_skip_for_url', function ( $skip, $image_url ) {
	if ( false !== strpos( $image_url, '/uploads/logos/' ) ) {
		return true;
	}

	return $skip;
}, 10, 2 );
```

The `powered_cache_image_optimizer_skip_image` filter can skip an image based on its full `<img>` tag, and `powered_cache_image_optimizer_disable` turns the feature off for a request. See the [Hooks Reference](/docs/hooks-reference/).

## Local and development sites

The delivery service must download your original images, so it cannot work on a site that only exists on your computer. Powered Cache keeps Image Optimization inactive when it detects a local or development site, even if the toggle is on, and the settings screen shows a warning: *Image Optimization requires a publicly accessible site and is disabled for local or development domains.*

A site counts as local when its address has no dot (such as `localhost`), ends in `.local`, `.localhost`, `.test`, `.docksal`, `.docksal.site`, `.dev.cc` or `.lndo.site`, or when the WordPress environment type is `local`. Staging sites on a public address are not treated as local. If such a site is protected with a password, the service cannot download the images.

> **Changed in 4.0:** Image Optimization now stays inactive on local and development sites, where remote delivery cannot work, and the settings screen explains why.

## Privacy

Because visitors load images from the delivery service, it receives the data found in normal web server logs, such as IP addresses, browser user agents, referrer URLs and your site URL. Powered Cache Premium adds a suggested paragraph about this to the WordPress privacy policy guide (Settings → Privacy).

## Troubleshooting

### Images still load from my own domain

- Check for the local-site warning on the Media screen.
- Clear the page cache. Pages cached before you turned the feature on still contain the old addresses.
- Check that the image type is supported and the address ends in a file extension.

### Images are broken or show an old version

Open the original image address in a private window. If your server, firewall or hotlink protection blocks it, the service cannot fetch it either. For an old version, use **Purge Image Cache**. If the purge fails, check that your license is active (see [License Issues](/docs/license-issues/)).

## Related docs

- [Lazy Load](/docs/lazy-load/)
- [Image Dimensions](/docs/image-dimensions/) (Premium)
- [LCP Optimization](/docs/lcp-optimization/) (Premium)
- [CDN Integration](/docs/cdn-integration/)
- [Free vs Premium](/docs/free-vs-premium/)
