Docs

TinyPNG

3 min readUpdated June 28, 2026

TinyPNG compresses JPEG, PNG, and WebP images via the TinyPNG API. WP Media Cloud and TinyPNG work correctly together for new uploads without any configuration. There are two limitations to be aware of when local file removal is enabled: bulk optimization of already-offloaded files and WebP picture tag serving.

How they work together#

New uploads

TinyPNG hooks into the WordPress upload process at a point that runs before WP Media Cloud’s offload handler. The sequence for new uploads is:

  1. WordPress generates attachment metadata after the upload
  2. TinyPNG compresses the file and all its sizes at this point
  3. WP Media Cloud’s offload handler runs and offloads the already-compressed file to cloud storage

New uploads are always offloaded in their compressed form. No additional configuration is needed and no re-offload occurs.

Bulk optimization of existing files

TinyPNG’s bulk optimization tool builds local filesystem paths and checks whether each file exists locally before sending it to the TinyPNG API. If local file removal is enabled in WP Media Cloud and local copies have been deleted, TinyPNG’s file existence check returns false and those files are silently skipped. Bulk optimization cannot run on files that do not have a local copy.

To use TinyPNG’s bulk optimization on already-offloaded files, leave local file removal disabled. This keeps local copies on the server so TinyPNG can find them, compress them, and write the compressed result back for WP Media Cloud to re-offload.

WebP picture tag serving

TinyPNG’s WebP serving feature wraps <img> elements in <picture> tags with WebP source alternatives. Like the bulk optimization tool, it checks whether the WebP variant exists on the local filesystem before inserting the source element. If local files have been removed, the check fails and TinyPNG falls back to a plain <img> tag.

This behaviour is the same as Imagify and different from Smush, which performs URL string substitution in memory and does not require local files for WebP serving.

Configuration#

No configuration is required in either plugin for new uploads to work correctly. WP Media Cloud detects TinyPNG automatically and reports its status on the Integrations tab.

TinyPNG requires an API key from tinypng.com/developers. The free tier includes 500 compressions per month. Above that, TinyPNG charges per compression on a pay-as-you-go basis with no subscription required. The API key is entered in TinyPNG’s own settings panel.

Summary of local file removal compatibility#

  • New uploads compressed before offloading — works correctly regardless of local file removal setting
  • Bulk optimization of existing offloaded files — requires local files to be present
  • WebP picture tag serving — requires local files to be present

If local file removal is enabled and you need to bulk compress already-offloaded files, temporarily disable local file removal, re-download the files from cloud storage, run TinyPNG bulk optimization, and re-enable local file removal once complete.

Troubleshooting#

TinyPNG bulk optimization is skipping files
Local copies of those files do not exist. TinyPNG checks for the file on the local filesystem before compressing. If local file removal is enabled in WP Media Cloud, the files are only in cloud storage and TinyPNG cannot find them. Disable local file removal and restore local copies before running bulk optimization.

WebP versions are not being served
Local copies of the WebP variants do not exist. Disable local file removal to keep local copies on the server, which allows TinyPNG to find and serve WebP versions via picture tags.

New uploads are not being compressed
Confirm TinyPNG is active and an API key is entered in TinyPNG’s settings. If the API key is missing or invalid, TinyPNG will not compress on upload and WP Media Cloud will offload the uncompressed original.

This website uses cookies to enhance your browsing experience and ensure the site functions properly. By continuing to use this site, you acknowledge and accept our use of cookies.

Accept All Accept Required Only