4. Smush API Docs
WPMU DEV is dedicated to supporting advanced users in every possible way. Our Smush API Documentation is an ongoing project. Information about new commands will be added here as it becomes available.
4.1 WP-CLI
Copy chapter anchor to clipboardWP-CLI is the command-line interface for WordPress. You can update plugins, configure multisite installations and much more, without using a web browser. Smush has an integration module with WP CLI, which will allow you to simplify a few common tasks.
Image optimization
Allows optimizing single images, batch optimization, as well as bulk optimization of the whole media library.
Command
wp smush compress [–type=] [–image=]
Parameters
Examples
Smush all images.
wp smush compress
Smush single image with ID = 10.
wp smush compress --type=single --image=10
Smush first 5 images.
wp smush compress --type=batch --image=5
Note that the wp smush compress command will respect all current settings in the Smush plugin on the site where the command is run. In other words, if the Super-Smush option is enabled on the site, running this command will super-smush the images.
List unoptimized images
Command
wp smush list []
Parameters
Examples
Get all unoptimized images.
wp smush list
Get the first 100 images that are not optimized.
wp smush list 100
Restore images
Allows restoring images that have backups (backups need to be enabled via the “Store a copy of my full size images” option in Smush).
Command
wp smush restore [–id=]
Parameters
Examples
Restore all images that have backups.
wp smush restore
Restore single image with ID = 10.
wp smush restore --id=10
Restore all images on a site with slug blog on a WordPress multisite instance using subdomains.
wp smush restore --url=blog.example.com
4.2 Get Support
Copy chapter anchor to clipboardIf you still have questions or need assistance after reading this document, please don’t hesitate to contact our support superheroes using the available options under the Support tab in your Hub or via the Support tab in your WPMU DEV Dashboard.