One of the many benefits of our WordPress Hosting plans is the ability to easily manage WordPress from the command line, using WP-CLI, or WordPress Command Line Interface. With WP-CLI, you can use the plugin command to manage your WordPress plugins from the command line. This command can be used to install, remove, update, and activate/deactivate a plugin. In this guide, you will learn how to install and activate a WordPress plugin using the WP-CLI plugin command.
Install and Activate a Plugin
- SSH into your server as the cPanel user that owns the website you would like to install the plugin on.
- Use the cd command to switch to the document root directory of your website.Example: cd public_html/my_websiteNOTE: Be sure to replace public_html/my_website with the actual path to the document root directory of your website.
- There are multiple ways to obtain/install a plugin. Click on one of the buttons below to expand the specific instructions for the method that works best for you. If you are unsure of which option to choose, we recommend expanding the Slug option to follow those instructions.
- Run the search subcommand below to find the plugin. Be sure to replace our example search term gutenberg with the name of the plugin you are searching for:wp plugin search gutenberg
- Note the slug value that appears next to the plugin you would like to install. You will use this as an option in the command to install and activate the plugin you searched for.The table below is an example of the output (search results) from running the command above:
Name Slug Rating Gutenberg gutenberg 52 Media Cleaner media-cleaner 92 WP Multilang wp-multilang 100 Custom CSS – Whole Site and Per Post custom-css-whole-site-and-per-post 68 Easy WP Meta Description easy-wp-meta-description 100 Classic Editor classic-editor 98 Gutenberg Custom Fields gutenberg-custom-fields 0 Blocks for Gutenberg blocks-for-gutenberg 0 Japanese font for gutenberg japanese-font-gutenberg 0 Dismiss try Gutenberg Nag Dashboard Widget dismiss-gutenberg-nag 0 - Run the following command replacing gutenberg with the slug value you found in your search:wp plugin install gutenberg –activate
- Download the plugin’s ZIP file and upload it to your server. Be sure to upload just the ZIP file to the document root directory of your website.
- Run the following command, replacing gutenberg.1.9.1.zip with your plugin’s actual file name:wp plugin install gutenberg.1.9.1.zip –activate
- Locate the URL to download the plugin you wish to install.
- Run the following command, replacing https://downloads.wordpress.org/plugin/gutenberg.1.9.1.zip with your plugin’s actual download link:wp plugin install https://downloads.wordpress.org/plugin/gutenberg.1.9.1.zip –activate
Congratulations! Now you know how to use WP-CLI to install a WordPress plugin from the command line. Want to learn more about WP-CLI? Be sure to check out our WP-CLI Education Channel.