List of constants to add in wp-config.php
The functionality of ShortPixel Image Optimizer can be extended by defining constants on the
wp-config.php file. What this means is that we can add several lines on that file to add some advanced features to the plugin.
First, locate the file, which must be on the root of your WordPress installation, and edit it.
Now, you must add each line before the line that says
/* That's all, stop editing! Happy blogging. */
We will see an example later.
List of constants
If you have a theme which creates thumbnails that don't have the usual suffix
WWW is the width and
HHH is the height of the image, and you want such thumbnails to be handled by ShortPixel too, you should add this line and add all the custom suffixes your theme is creating separated by commas.
For example, the line above will handle the images with the suffixes _tl and _tr, like
This constant does the same as the previous but treating infixes. For example, custom thumbnails like
define('SHORTPIXEL_API_KEY', '<<your api key here>>');
<<your api key here>>with your actual API Key.
This will make your site to not use the flock queue; only activate this when you have
flock() denied errors on your installation.
define('SHORTPIXEL_CFTOKEN', '<<the Cloudflare API token that has Purge Cache right>>'); define('SHORTPIXEL_CFZONE', '<<The Zone ID from the domain settings in Cloudflare>>');
Hide the Cloudflare settings (Settings > ShortPixel > Cloudflare).
Hide the WordPress Speed Optimization (WSO) banner on the Settings screen.