Image Optimization, Compression and WebP
The Staq infrastructure can optimize (compress size and convert to WebP) your WordPress media library images directly on the server — no third-party plugins or external services required. This reduces file sizes, improves page load speed, and optionally generates WebP versions of your images.
Note: Media Optimisation is disabled by default. You must enable it once per website inside WordPress.
How It Works
Once enabled, optimisation runs automatically in the background. Before any compression takes place, your original images are safely backed up to S3, allowing you to restore them at any time.
Staq uses proven server-side tools:
- JPEG/JPG: Recompressed using
jpegoptim - PNG: Optimised using
pngquant+optipng - WebP: Generated using
cwebpas a sidecar file (original files remain untouched)
How to Enable Media (JPEG & PNG) Optimisation
- Log into the WordPress site.
- Click Staq Hosting.
- Open the Media tab.
- Enable Media optimisation.
- Adjust settings if required (defaults are recommended).
- Click Save Settings.

Once saved, Staq will automatically queue a background job to process JPEG and PNG images in your media library.
Enabling WebP Conversion
WebP creates smaller versions of your images without replacing the originals.
- Go to Staq Hosting → Media.
- Enable WebP Conversion:

Then ensure WebP delivery is enabled:
- Go to Optimizer → Media.
- Enable Serve next-gen images (WebP).
When enabled, cached pages will automatically serve WebP images where supported.
Note: WebP replacement does not apply to images inside CSS files.
What Gets Optimised
- JPEG/JPG: Compressed + optional WebP
- PNG: Compressed + optional WebP
- WebP: Not reprocessed
- SVG: Not processed
- GIF: Not processed
- Videos: Not supported
Minimum thresholds:
- Under 10KB → compression skipped
- Under 4KB → WebP skipped
How Optimisation Is Triggered
- On Upload: Images are queued immediately
- Daily Scan: Detects unoptimised images via nginx logs
- On Save: Saving settings triggers a full scan
No manual action is required.
Reverting to Original Images
- Go to Media → Overview
- Click Revert to Originals
This restores images from S3 and removes generated WebP files.
Statistics
Overview Statistics
To view total compression savings:
- Go to Staq Hosting → Media → Overview
- View total size reduction and performance gains

Specific Image Statistics
To view details for a specific image:
- Go to Media Library
- Select an image
- Click More Details under the optimisation label

Viewing WebP Images
To confirm WebP is generated:
- Open the image in the Media Library
- Look for the Optimisation label
- If WebP is enabled, you will see:
- WebP file size
- Compression savings
- Option to copy the WebP URL

Need some help?
We all do sometimes. Please reach out to our support team by dropping us a support ticket. We will respond fast.