New Feature: Earn 12 Badges
Collect up to 12 exclusive badges by sharing your plugin collections and engaging with the community.
See all Badgesby ShortPixel – Convert WebP/AVIF & Optimize Images
Boost your site’s speed instantly! Optimize images and PDFs with one click, bulk compress to WebP and AVIF, use lazy loading, and resize images.
Increase your website’s SEO ranking, number of visitors, and ultimately your sales by optimising any image or PDF document on your website.
The ShortPixel plugin is a lightweight, user-friendly, install-and-forget solution for image optimization.
It is designed to work with any website type, whether it’s a small blog or a large WooCommerce-powered online store with tens of thousands of products.
Additionally, it’s an excellent choice for agencies, offering unlimited image optimization credits for a flat monthly fee.
Test our plugin here.
Make an instant image compression test of your site or compress some images to test our optimization algorithms.
Both lossy and lossless image compression are available for the most common image types (JPG, PNG, GIF, WebP, and AVIF) plus PDF files.
We also offer glossy JPEG compression which is a very high-quality lossy optimization algorithm. Especially designed for photographers or for high-quality product pictures.
Optimized images lead to a better user experience, improved PageSpeed Insights or GTmetrix results, higher Google PageRank, and more visitors.
ShortPixel uses minimal resources and works well with any shared, cloud, VPS, or dedicated web hosting. It can optimize any image on your website, including those not listed in the Media Library, such as images in galleries or those added directly via FTP.
All optimization is performed using ShortPixel’s Image Optimization Cloud, so your hosting resources remain unaffected.
New Plan: ShortPixel Unlimited
This is the ideal monthly plan for web agencies or website owners with multiple sites and frequent image uploads.
It allows you to optimize an unlimited number of images with ShortPixel Image Optimizer or use ShortPixel Adaptive Images without worrying about CDN traffic limits.
Read more details on our dedicated page.
How much does it cost?
ShortPixel comes with 100 free credits per month, and additional unlimited monthly credits can be purchased for $9.99.
One-time credit packages that never expire are available starting at $19.99.
Check out our prices.
Testimonials:
★★★★★ A Super Plugin works very well 62% reduction overall. robertvarns
★★★★★ The secret sauce for a WordPress website. mark1mark
★★★★★ A must have plugin, great support! ElColo13
★★★★★ Excellent Plugin! Even Better Customer Service! scaliendo
★★★★★ Great image compression, solid plugin, equally great support. matters1959
more testimonials
Help us spread the word by recommending ShortPixel to your friends and collect 100 lifetime monthly additional image credits for each referred active user. Make money by promoting a great plugin with our 30% commission affiliate program.
Other plugins by ShortPixel
Get in touch!
The ShortPixel Image Optimiser plugin calls the following actions and filters:
do_action( 'shortpixel_image_optimised', $post_id );
upon successful optimization;
do_action("shortpixel_before_restore_image", $post_id);
before restoring an image from backup;
do_action("shortpixel_after_restore_image", $post_id);
after succesful restore;
For version 4.22.10 and earlier:
apply_filters("shortpixel_backup_folder", $backup_folder, $main_file_path, $sizes);
just before returning the ShortPixel backup folder, usually /wp-content/uploads/ShortpixelBackups. The $sizes
are the sizes array from metadata;
For version 5.0.0 and later:
$directory = apply_filters("shortpixel/file/backup_folder", $directory, $file);
just before returning the ShortPixel backup folder, usually /wp-content/uploads/ShortpixelBackups).
apply_filters('shortpixel_image_exists', file_exists($path), $path, $post_id);
post ID is not always set, only if it’s an image from Media Library;
apply_filters('shortpixel_image_urls', $URLs, $post_id);
filters the URLs that will be sent to optimisation, $URLs
is a plain array;
The filter below is deprecated starting with version 5.0.0!
apply_filters('shortpixel/db/chunk_size', $chunk);
the $chunk
is the value ShortPixel chooses to use as the number of selected records in one query (based on total table size), some hosts work better with a different value;
For version 4.22.10 and earlier:
apply_filters('shortpixel/backup/paths', $PATHs, $mainPath);
filters the array of paths of the images sent for backup and can be used to exclude certain paths/images/thumbs from being backed up, based on the image path. $mainPath
is the path of the main image, while $PATHs
is an array with all files to be backed up (including thumbnails);
For version 5.0.0 and later:
apply_filters('shortpixel/image/skip_backup', false, $this->getFullPath(), $this->is_main_file)
filters the images that are skipped or not from the backup. Return true for the type of images to be skipped in the backup. If you check if is_main_file
is true and return false (do not skip backup), while while otherwise returning true, the backup will be kept only for the main image. We suggest using it in conjuction with this action that fires right after the restore from backup is done:
do_action('shortpixel/image/after_restore', $this, $this->id, $cleanRestore);
This action can be used to cleanup the meta data from the database, regenerate thumbnails after restoring the main file, writing the updated meta data, etc.
apply_filters('shortpixel/settings/image_sizes', $sizes);
filters the array ($sizes
) of image sizes that can be excluded from processing (displayed in the plugin Advanced settings);
apply_filters('shortpixel/image/imageparamlist', $result, $this->id, $this);
filters the list of parameters sent to the API so that resizing can be performed more granularly;
apply_filters('shortpixel/api/request', $requestParameters, $item_id);
filters the parameters sent to the optimization API (through $requestParameters
), described in detail here: ShortPixel Reducer API; $item_id
contains the ID of the Media Library item, or the ID of the Custom Media item (when used). In short, this filter can be used to alter any parameters sent to the API, depending on the needs. For example, you can set different resize parameters for different post types, different compression levels, remove EXIF or not, covert WebP/AVIF, and basically any other parameter that is sent to the API for a specific image (together with all its thumbnails).
This filter enables the background ShortPixel processing in additional pages (see here the original list). Here’s an example of this filter that enables the processing on the Comments screen (to be placed in your functions.php file):
add_filter('shortpixel/init/optimize_on_screens', function ($screens) {
$screens[] = 'edit-comments';
return $screens;
});
The edit-comments
is the ID of the screen where you want to enable the processing.
If you want to add multiple pages, here’s what the snippet looks like:
add_filter('shortpixel/init/optimize_on_screens', function ($screens) {
$screens = array('edit-comments', 'plugins', 'another-custom-post-type-page');
return $screens;
});
add_filter('shortpixel/image/filecheck', function () { return true; });
This filter forces a file check for WebP/AVIF in case they were manually removed from disk.
If you want to disable the automatic cache flush that is triggered after image optimization, you can use this filter:
add_filter( 'shortpixel/external/flush_cache', function() { return false; } );
In order to define custom thumbnails to be picked up by the optimization you have two options, both comma separated defines:
define('SHORTPIXEL_CUSTOM_THUMB_SUFFIXES', '_tl,_tr');
will handle custom thumbnails like image-100x100_tl.jpg;
define('SHORTPIXEL_CUSTOM_THUMB_INFIXES', '-uae');
will handle custom thumbnails like image-uae-100×100.jpg;
define('SHORTPIXEL_USE_DOUBLE_WEBP_EXTENSION', true);
define('SHORTPIXEL_USE_DOUBLE_AVIF_EXTENSION', true);
will tell the plugin to create double extensions for the WebP/AVIF image counterparts, for example, image.jpg.webp/image.jpg.avif for image.jpg;
Enable the “Trusted mode” in case the file system has limitations and is very slow in responding to direct file operations by adding this constant:
define('SHORTPIXEL_TRUSTED_MODE', true);
This will simply skip file check operations and if the Media Library loads very slowly or freezes, you might want to try adding the constant above to your wp-config.php file.
Disable the feedback survey when the plugin is deactivated:
define('SHORTPIXEL_SKIP_FEEDBACK', true);
Hide the Cloudflare settings by defining these constants in wp-config.php:
define('SHORTPIXEL_CFTOKEN', 'the Cloudflare API token that has Purge Cache right');
define('SHORTPIXEL_CFZONE', 'The Zone ID from the domain settings in Cloudflare');
Add HTTP basic authentication credentials by defining these constants in wp-config.php
define('SHORTPIXEL_HTTP_AUTH_USER', 'user');
define('SHORTPIXEL_HTTP_AUTH_PASSWORD', 'pass');
All texts and images on this product page are protected by copyright and are the property of the author ShortPixel – Convert WebP/AVIF & Optimize Images. You will be redirected to the retailer to download the plugin. We act solely as a search engine for plugins and are not affiliated with the retailer or ShortPixel – Convert WebP/AVIF & Optimize Images.
4.5-star rating from 768 customers.
No results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
ResetNo results available
Reset