Your search returned no hits.
95% of all problems already have a solution in our knowledgebase
Added: 14.11.2019 11:31:37 Last updated: 19.10.2020 12:51:27
WP-CLI is the command line interface for WordPress. You can update plugins, configure multisite installations and much more, without using a browser. For example, it can be used in "Terminal" inside cPanel.
It is installed on all our servers and can be used as long as one has Pro Medium or larger web hosting.
Useful commands with examples
There are many commands available for WP-CLI, but on this page we will only go over a few examples. For more detailed commands, we recommend taking a look at the manual.
The command below will list subcommands and parameters that can be used with the "wp" command.
wp cli info will display some information that may be useful to use for different occasions.
It will list the things below:
3. Database backup
Backup is often necessary to make prior to major changes or upgrades to the website. The command will export the WordPress database as a .sql file in the same directory as the WordPress install.
It is also possible to export to the desired filename instead of a random name by using the command: wp db export choosename.sql
4. Database repair and optimization
To avoid logging into phpMyadmin and cPanel you can optimize and repair the database directly from wp-cli with the commands below.
5. Size of database and tables
If you want to check the sizes of the tables and if any of them need optimization then the command below will list all the sizes of all tables in the database.
6. wp-config information and path
Sometimes wp-config.php may be located in a folder other than the WordPress installation itself. Then the following command may be useful to find the entire path of the file:
If you need to see for example the database password and the rest of the wp-config.php file without opening and downloading the file, this can be done with the command:
7. Plugin overview
The commands below will list all plugins, both active and inactive. It will also show which plugins have available updates.
8. Plugin update
If the akismet plugin is outdated it can easily be updated with the wp-cli command:
If you want to update all plugins on the page, this command can be used:
9. How to update WordPress themes with WP CLI
For a full overview, check out the developer reference at WordPress.