Getting started with LeanPixel

From download to a lighter media library in a few minutes.

Install

  1. Download the plugin zip.
  2. In WordPress, go to Plugins → Add New → Upload Plugin, choose the zip and click Install Now.
  3. Click Activate. You are taken to Media → LeanPixel.

Connect

  1. Enter your email address.
  2. Click “Get my free API key”. Your site is now connected.

Or, to keep everything on your own server, click “Process images on this server” instead. No email or key is needed.

Optimize your existing images

  1. On Media → LeanPixel, click “Optimize all images”.
  2. Progress is shown on the screen. You can leave the page; work continues in the background.

Settings

Process images on this server Off by default
When on, images are compressed on your own server and nothing is sent to our service. Savings are usually smaller, GIF images are left as they are, and at the Lossless level JPEG files are not re-compressed.
Compression level Balanced by default
Lossless keeps every pixel. Balanced suits most sites. Aggressive gives the smallest files.
Optimize new uploads automatically On by default
Every new upload is optimized as it arrives.
Keep a copy of every original On by default
Needed for Restore.
Create WebP versions On by default
A WebP copy is saved next to each image.
Create AVIF versions Off by default
AVIF files are smaller still but take longer to create.
Serve the WebP/AVIF version Off by default
Switch on to deliver the newer formats to browsers that support them.
Keep photo details (EXIF) Off by default
Camera and location details are removed unless this is on.
Images to leave alone Empty by default
One rule per line. An image is skipped when its location in the uploads folder contains the rule (for example 2019/ or logo). Use * for any text.
CDN Empty by default
Enter the address your CDN gave you (for example https://yourname.b-cdn.net). LeanPixel loads a test image through it and only switches it on if that works.
Maximum image size Off by default
Choose 1920, 2560 or 3840 pixels to scale down larger images.

Restore an image

In the media library, click “Restore original” next to the image. To restore several, switch to list view, select them and choose “Restore originals (LeanPixel)” from Bulk actions.

Free up disk space

On Media → LeanPixel, the “Kept originals” box shows how much space they use. Click “Delete kept originals” once you are happy with the results. After that, Restore is no longer available for those images.

nginx

If your site runs on nginx, switch on “Serve the WebP/AVIF version” and copy the lines the plugin shows into your server configuration, then reload nginx.