How to schedule a cron event to run ShortPixel Image Optimizer
By default, ShortPixel Image Optimizer (SPIO) only optimizes images if one of these pages is open on your browser. But what happens if you don't have the time (or will) to do it? You can always schedule SPIO to run even when your computer is off. Just follow these instructions.
Option 1: Add a cron job manually
Please note that you must to have the option "Optimize media on upload" enabled in order for this to work properly! (The option is enabled by default)
- Install and activate the WP Crontrol plugin.
Go to Tools > Cron Events and then click on "Add New".
- In the Hook Name field, enter
shortpixel/hook/processqueue
. - In the Recurrence field, select how often you want ShortPixel to process your images (we recommend once hourly).
Leave the rest of the fields as they are. It should look like this:
- Click on "Add Event".
As an alternative to WP Crontrol, the same effect can be achieved with the Advanced Cron Manager plugin.
After doing this, the newly uploaded images should get processed by our plugin every hour, and you won't even need to log in to your WordPress site.
Option 2: Use Background mode
With version 5.6, ShortPixel has introduced a new feature called "Background Mode", which creates cron jobs for you, allowing you to optimize images in the background.
You can find all the information you need here: Background processing using cron jobs in ShortPixel Image Optimizer