Install a Plugin Using WP-CLI

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

  1. SSH into your server as the cPanel user that owns the website you would like to install the plugin on.
  2. Use the cd command to switch to the document root directory of your website.Example: cd public_html/my_website
  3. 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.
    1. 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
    2. 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:
      NameSlugRating
      Gutenberggutenberg52
      Media Cleanermedia-cleaner92
      WP Multilangwp-multilang100
      Custom CSS – Whole Site and Per Postcustom-css-whole-site-and-per-post68
      Easy WP Meta Descriptioneasy-wp-meta-description100
      Classic Editorclassic-editor98
      Gutenberg Custom Fieldsgutenberg-custom-fields0
      Blocks for Gutenbergblocks-for-gutenberg0
      Japanese font for gutenbergjapanese-font-gutenberg0
      Dismiss try Gutenberg Nag Dashboard Widgetdismiss-gutenberg-nag0
    3. Run the following command replacing gutenberg with the slug value you found in your search:wp plugin install gutenberg –activate

    1. 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.
    2. 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

    1. Locate the URL to download the plugin you wish to install.
    2. 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.

JB
John-Paul Briones Content Writer II

John-Paul is an Electronics Engineer that spent most of his career in IT. He has been a Technical Writer for InMotion since 2013.

More Articles by John-Paul

Was this article helpful? Join the conversation!