• Get In Touch
August 4, 2017

What is WP-Cli And Why You Probably Need It

Need Hosting? Try ours, it's fast, reliable and feature loaded with support you can depend on.
View Plans

Wp-Cli is a command line tool specifically made to manage your WordPress websites through the command line. By entering some simple commands you will be able to carry out tasks such as backing up, installing or updating plugins and even publishing content, without having to log in to your WordPress admin. Wp-Cli saves you time by getting rid of the need to navigate web pages to run your site and is especially useful if you are a WordPress developer or System administrator.  

In this guide, I will show you how to install Wp-Cli and how to carry out simple commands. It should be noted that in order to install Wp-Cli you will need to make sure you have a hosting account with SSH access. Other system requirements are PHP 5.3.2 or later, WordPress 3.4 or later and a Unix like environment such as Linux. We provide, and install WP-Cli for you with our hosting.

How to install Wp-Cli

Step 1. The recommended way to install Wp-Cli is by downloading the Phar build, making it executable, and placing it on your PATH. The latest version of the file can be found at https://raw.github.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Step 2. Using the cURL command type curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar This will download and extract the Wp-Cli files to your root user directory.

Step 3. Next, it’s time to set the permissions to make it executable. Enter the following command: chmod +x wp-cli.phar

Step 4. It’s best to move the Wp-Cli.phar to a folder and rename it ‘wp’. This will help you use the Wp-Cli commands just by typing ‘wp’ at the start of the commands.

That’s all there is to installing Wp-Cli! If you need more information for troubleshooting, that can be found over at https://make.wordpress.org/cli/handbook/installing/. Now, let’s jump into an overview of some simple commands we can make.

Using the Wp-Cli help system

Wp-Cli comes with a full help system. This can be accessed by typing: wp help.

Installing themes with Wp-Cli

Importing and installing themes is a lot quicker through Wp-Cli as opposed to logging in via WordPress admin and activating it. Wp-Cli connects your server directly to the WordPress theme repository allowing it to install themes in a second. Let’s use the themes ‘twenty seventeen’ as an example.

Simply type in the following command: wp theme install twentyten

Likewise, if you wanted to install the theme ‘simplicity lite’, you would just need to enter: wp theme install simplicitylite

While this will install the themes on your site it will not activate them. To do that you will need to type the command: wp theme activate twentyten

The command display when installing the Twenty Ten theme.

Installing Plugins with Wp-Cli

Just like with the themes, plugins can be installed straight from the official repository. Once again, installation is seamless and takes next to no time.

For example: wp plugin install yoastseo

The above command line will install the Yoast SEO plugin on your website. To activate it just simply type: wp plugin activate yoastseo

To deactivate any plugin just type: wp plugin deactivate yoastseo. Simple stuff!

Updating Themes, Plugins and WordPress core with Wp-Cli

Time-consuming tasks such as updating core features can be a hassle, but thankfully this can be taken care of easily through some command inputs.

To update WordPress to the latest, stable version, simply enter: wp core update

Wp-Cli will also let you update to the specific version of WordPress you want. So if you want to update to WordPress version 3.9 instead of 4.2, simply enter: wp core update — version=3.9

When it comes to updating plugins you can update all at once or just specify a single one. To update all enter: wp plugin update — all

Likewise, for a specific plugin, you should enter: wp plugin update yoastseo

This exact method applies for themes as well and would be as follows: wp theme update — all , or, wp theme update twentyten

Need Hosting? Try ours, it's fast, reliable and feature loaded with support you can depend on.
View Plans

Share this Article!

Related Posts

5 Website Hosting Solution Trends for 2022 and Beyond

5 Website Hosting Solution Trends for 2022 and Beyond

Looking for the right web hosting solution for your website can be an intimidating task. Options nowadays are more diversified than ever, and each year brings new developments in the web hosting market. If you have no clue of what to look out for, you can find yourself overwhelmed with the choices. Hence, you must […]

64 Content Marketing Statistics Demonstrating the Power of Content

64 Content Marketing Statistics Demonstrating the Power of Content

Content marketing continues to be one of the most valuable tools for today’s online businesses. With content, you can improve your chances of reaching your target audience, boost your search engine standing, and even unlock new opportunities for sales. The more content you produce, the more you can strengthen your domain authority, demonstrate your thought […]

53 User Experience Stats for 2022

53 User Experience Stats for 2022

User Experience (UX) is one of the most crucial factors to consider in web design. As the number of websites and applications in the world today continues to accelerate, businesses are under more pressure than ever to impress customers straight away. If a user visits your website and finds slow-loading pages, clunky navigation, or errors, […]

How to increase the memory limit in WordPress

How to increase the memory limit in WordPress

Do you need to increase the memory limit in WordPress? Getting an error about memory Exhausted? The memory limit is one of the most common WordPress errors as the default limit of memory in WordPress is only set to 64mb! But there’s good news! The Memory Exhausted error is one of the easiest to fix […]

All in One WordPress Migration Vulnerability

All in One WordPress Migration Vulnerability

A vulnerability has been discovered in the “All In One WordPress Migration” WordPress plugin. All versions earlier than, and including 6.97 contain a vulnerability which allows Cross-Site Scripting (XSS). With over 2 million active installations, this vulnerability has the potential to be high impact, however, this is lessened by the nature of the vulnerability, which […]