WP-CLI is a powerful command tool that can help streamline your workflow by enabling you to manage plugins and themes from the command line. Typically it’s used by more advanced users or those responsible for working on a large number of sites, for example, a developer at an agency or freelancer.
You can use WP-CLI along with Perfmatters to perform basic everyday tasks, and we’ll keep expanding support over time. Below are the current commands we support.
Activate plugin
To activate the Perfmatters plugin, use the following command.
wp plugin activate perfmatters
Deactivate plugin
To deactivate the Perfmatters plugin, use the following command.
wp plugin deactivate perfmatters
Activate license
To activate the license key in Perfmatters, use the following command. This assumes you’ve already entered the license key into the activation field under the license tab.
wp perfmatters activate-license
You can also include the license key in WP-CLI by adding the <key>
on the end.
wp perfmatters activate-license [<key>]
An unlimited license is required to activate sites in a multisite environment. If you need to run commands on a subsite, you can specify the global URL parameter.
wp perfmatters activate-license [<key>] --url=<url>
Deactivate license
To deactivate the license key in Perfmatters, use the following command.
wp perfmatters deactivate-license
To deactivate the license on a subsite in a multisite environment, you can specify the global URL parameter.
wp perfmatters deactivate-license --url=<url>
Remove license
To remove the license key in Perfmatters, use the following command.
wp perfmatters remove-license
To remove the license on a subsite in a multisite environment, you can specify the global URL parameter.
wp perfmatters remove-license --url=<url>
Clear used CSS
You can clear the used CSS in Perfmatters using the following command.
wp perfmatters clear-used-css
To clear the used CSS on a subsite in a multisite environment, you can specify the global URL parameter.
wp perfmatters clear-used-css --url=<url>
To clear the used CSS across an entire multisite network (all subsites), you can use the global network parameter.
wp perfmatters clear-used-css --network