{"id":64194,"date":"2022-02-16T07:32:09","date_gmt":"2022-02-16T13:32:09","guid":{"rendered":"https:\/\/www.scalahosting.com\/blog\/?p=64194"},"modified":"2025-12-09T03:10:51","modified_gmt":"2025-12-09T09:10:51","slug":"what-is-wp-cli-a-beginners-guide","status":"publish","type":"post","link":"https:\/\/www.scalahosting.com\/blog\/what-is-wp-cli-a-beginners-guide\/","title":{"rendered":"What is WP-CLI? A Beginner&#8217;s Guide"},"content":{"rendered":"\n<p>Although it enables people with no technical skills to build their own personal websites, WordPress was never targeted exclusively at complete novices. It&#8217;s a<strong> powerful content management system<\/strong> that gives you the freedom to <strong>build and manage functional websites <\/strong>with numerous useful features and a great user experience. It&#8217;s suitable for both big and small projects, and it gives site owners access to tools that can improve the workflow and make administration a lot easier.<\/p>\n\n\n\n<p><strong>WP-CLI<\/strong> is one such tool.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/launchpresso-IOM28XWsk-g-unsplash-scaled.jpg\"><img decoding=\"async\" width=\"1024\" height=\"576\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/launchpresso-IOM28XWsk-g-unsplash-1024x576.jpg\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide\" class=\"wp-image-64198\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/launchpresso-IOM28XWsk-g-unsplash-1024x576.jpg 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/launchpresso-IOM28XWsk-g-unsplash-300x169.jpg 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/launchpresso-IOM28XWsk-g-unsplash-768x432.jpg 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/launchpresso-IOM28XWsk-g-unsplash-1536x864.jpg 1536w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/launchpresso-IOM28XWsk-g-unsplash-2048x1152.jpg 2048w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"what\"><strong>What is WP-CLI?<\/strong><\/h2>\n\n\n\n<p>People associate WordPress with the famously user-friendly <a href=\"https:\/\/www.scalahosting.com\/blog\/navigating-your-wordpress-dashboard\/\"><strong>WP dashboard<\/strong><\/a>. This is where you can change the <em>website&#8217;s settings, install, activate, and delete themes and plugins<\/em>, and manage your content. The dashboard is easy-to-navigate around, and all the utilities for managing the website are organized in<strong> a single point-and-click interface<\/strong>.<\/p>\n\n\n\n<p>However, as convenient as it is, the dashboard <strong>may not be the best way<\/strong> of carrying out some day-to-day site administration tasks. For many people, WP-CLI is a faster, more efficient alternative.<\/p>\n\n\n\n<p>WP-CLI is <strong>the official command-line interface for WordPress<\/strong>. You can do pretty much everything you do with the dashboard, but instead of clicking the mouse on buttons and menus, you write commands and execute them.Many of you may be struggling to grasp how this could be a more efficient way of managing a website.<\/p>\n\n\n\n<p>Well, you may not be surprised to learn that WP-CLI was built with experienced site administrators in mind. Because they&#8217;ve worked with a command-line interface in the past, they have an easier time understanding <strong>the logic behind the commands<\/strong>, which, in turn, helps them make the most of WP-CLI. And the truth is, <strong>WP-CLI is quite a powerful tool.<\/strong><\/p>\n\n\n\n<p>For example, if you&#8217;ve built dozens of <a href=\"https:\/\/www.scalahosting.com\/kb\/how-to-create-a-wordpress-website-for-beginners\/\"><strong>WordPress websites<\/strong><\/a><strong> <\/strong>already, you likely have <strong>a selection of plugins<\/strong> that you want to install at the very beginning of starting a new project. If you use the dashboard, this would mean setting up and activating all the add-ons one by one. With WP-CLI, it can all happen with <strong>a single command<\/strong>.<\/p>\n\n\n\n<p>It can be <strong>an enormous time-saver<\/strong>, and the truth is, although the command line interface may seem a bit daunting at first, once you grasp the commands&#8217; syntax, you&#8217;ll realize that <strong>WP-CLI is not that difficult to use<\/strong>.<\/p>\n\n\n\n<p>Even if you don&#8217;t find it particularly convenient and prefer to stick with the dashboard, getting to know it will help you <strong>learn more about how your website works<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/nathan-da-silva-k-rKfqSm4L4-unsplash-scaled.jpg\"><img decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/nathan-da-silva-k-rKfqSm4L4-unsplash-1024x683.jpg\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, What is WP-CLI?\" class=\"wp-image-64200\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/nathan-da-silva-k-rKfqSm4L4-unsplash-1024x683.jpg 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/nathan-da-silva-k-rKfqSm4L4-unsplash-300x200.jpg 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/nathan-da-silva-k-rKfqSm4L4-unsplash-768x512.jpg 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/nathan-da-silva-k-rKfqSm4L4-unsplash-1536x1024.jpg 1536w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/nathan-da-silva-k-rKfqSm4L4-unsplash-2048x1365.jpg 2048w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"need\"><strong>What Do You Need to Use the WordPress Command-Line Interface?<\/strong><\/h2>\n\n\n\n<p>Most likely, the server hosting your website runs on Linux, so to access its command-line interface, you&#8217;ll need to use the <strong>SSH protocol<\/strong>. <a href=\"https:\/\/www.scalahosting.com\/kb\/access-server-ssh\/\"><strong>Accessing the server via SSH<\/strong><\/a> no longer requires any additional tools. Old versions of Windows don&#8217;t support SSH out of the box, and establishing a connection from them is only possible via a dedicated client.&nbsp;<\/p>\n\n\n\n<p>However, due to user demand, Microsoft introduced <strong>native SSH support with a Windows 10 update from 2018<\/strong>. Unless you&#8217;re using a Windows version older than that, you should be able to log into your server via the <strong>PowerShell<\/strong> utility. <strong>Linux<\/strong> and <strong>macOS<\/strong> users can simply use the Terminal.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"access\"><strong>How Do You Access The WordPress Command-Line Interface?<\/strong><\/h2>\n\n\n\n<p>Establishing an SSH connection to the server is usually pretty easy, especially if your domain name is pointed correctly. After <strong>opening PowerShell or the Terminal<\/strong>, you&#8217;ll need to write a command using the following pattern:<\/p>\n\n\n\n<p class=\"alert-orange\"><strong>ssh [<\/strong><strong><em>your username<\/em><\/strong><strong>]@[<\/strong><strong><em>your domain name<\/em><\/strong><strong>]<\/strong><\/p>\n\n\n\n<p>The system will ask you for your password, and after you enter it, you will be in.<\/p>\n\n\n\n<p class=\"alert-blue\"><strong><em>NOTE<\/em><\/strong><em>: If your domain name is still not pointed to the hosting server, you can use <\/em><strong><em>the server&#8217;s IP<\/em><\/strong><em>.<\/em><\/p>\n\n\n\n<p>By default, SSH connections are established on <strong>port 22<\/strong>, but some hosting companies change it for additional security. If that&#8217;s the case, you&#8217;ll need to add <strong>-p[<\/strong><strong><em>your host&#8217;s SSH port<\/em><\/strong><strong>] <\/strong>to the login command. For example, at ScalaHosting, we&#8217;ve configured our <a href=\"https:\/\/www.scalahosting.com\/managed-cloud-hosting.html\"><strong>managed VPS<\/strong><\/a> to use <strong>port 6543<\/strong> for SSH connections, so when you&#8217;re logging in, you&#8217;ll see something like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-1.png\"><img decoding=\"async\" width=\"754\" height=\"474\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-1.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, How Do You Access The WordPress Command-Line Interface?\" class=\"wp-image-64201\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-1.png 754w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-1-300x189.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>When you successfully log in, you&#8217;ll want to <strong>check whether WP-CLI is installed<\/strong>.<\/p>\n\n\n\n<p>Because it&#8217;s so popular, most hosting providers offer WP-CLI with their shared and managed plans, and information about it should be available on your host&#8217;s web pages.<strong>&nbsp;<\/strong><\/p>\n\n\n\n<p><strong>If you&#8217;re already logged in via SSH, you can check whether WP-CLI is installed with the following command:<\/strong><\/p>\n\n\n\n<p><strong>wp &#8211;info<\/strong><\/p>\n\n\n\n<p><strong>If WP-CLI is included in your hosting account, the output should look something like this:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-2.png\"><img decoding=\"async\" width=\"749\" height=\"466\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-2.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, How Do You Access The WordPress Command-Line Interface? 2\" class=\"wp-image-64202\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-2.png 749w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-2-300x187.png 300w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>If it isn&#8217;t available, you&#8217;ll need to set it up yourself, which sounds more daunting than it is.<\/p>\n\n\n\n<p><strong>First, you have to download the PHP archive file with the following command:<\/strong><\/p>\n\n\n\n<p class=\"alert-orange\"><em>curl -O https:\/\/raw.githubusercontent.com\/wp-cli\/builds\/gh-pages\/phar\/wp-cli.phar<\/em><\/p>\n\n\n\n<p><strong>Next, you&#8217;ll want to change the file&#8217;s permissions and make it executable:<\/strong><\/p>\n\n\n\n<p class=\"alert-orange\"><em>chmod +x wp-cli.phar<\/em><\/p>\n\n\n\n<p><strong>Finally, to make sure you can use the PHAR file with the wp command, you need to move it to your server&#8217;s <\/strong><strong><em>bin<\/em><\/strong><strong> folder. The command is:<\/strong><\/p>\n\n\n\n<p class=\"alert-orange\"><em>sudo mv wp-cli.phar \/usr\/local\/bin\/wp<\/em><\/p>\n\n\n\n<p>As you can see from the command above, <strong>installing WP-CLI requires root access<\/strong>. If it&#8217;s not included in your hosting plan, you may need to ask your host&#8217;s support team for assistance.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/bash-148836_1280.png\"><img decoding=\"async\" width=\"1024\" height=\"810\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/bash-148836_1280-1024x810.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, How Do You Access The WordPress Command-Line Interface? 3\" class=\"wp-image-64203\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/bash-148836_1280-1024x810.png 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/bash-148836_1280-300x237.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/bash-148836_1280-768x607.png 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/bash-148836_1280.png 1280w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"do\"><strong>What Can You Do With WP-CLI?<\/strong><\/h2>\n\n\n\n<p>The list of things to do with WP-CLI is too long to fit in a single article. Thankfully, <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/\">the official documentation<\/a> is pretty detailed, and there&#8217;s no shortage of tutorials explaining how you can use WP-CLI to improve your workflow. The <strong>wp help<\/strong> command can also be helpful if you get stuck.<\/p>\n\n\n\n<p>However, to give you an idea of how powerful WP-CLI is, we&#8217;ll now give you a short tour of some of the functions you&#8217;re most likely to explore.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"installation\"><strong>Installing WordPress and managing your installation<\/strong><\/h3>\n\n\n\n<p>You can use WP-CLI to set up <strong>a brand new WordPress installation<\/strong> on your account. Obviously, you first need to navigate to the directory where your site will be hosted (usually, the <strong>public_html<\/strong> folder).<\/p>\n\n\n\n<p>Before you can do anything, you need to set up the <strong>website&#8217;s database and MySQL user<\/strong>. In some rare cases, you may need to do it via the console, though most hosts include <strong>GUI-based database management systems<\/strong> in their plans.<\/p>\n\n\n\n<p><strong>Here, for example, is the interface if you use one of ScalaHosting&#8217;s SPanel managed VPS:<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-3.png\"><img decoding=\"async\" width=\"1024\" height=\"527\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-3-1024x527.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing WordPress and managing your installation\" class=\"wp-image-64204\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-3-1024x527.png 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-3-300x154.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-3-768x395.png 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-3-1536x790.png 1536w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-3.png 1903w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p class=\"alert-blue\"><strong>NOTE:<\/strong> Remember to take note of <strong>the login credentials you set for the MySQL user<\/strong>, as you&#8217;ll need them during the next step.<\/p>\n\n\n\n<p>With the database set up, you need to <strong>download the WordPress core files<\/strong>. Use the following command:<\/p>\n\n\n\n<p><strong>wp core download<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-4.png\"><img decoding=\"async\" width=\"1024\" height=\"391\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-4-1024x391.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing WordPress and managing your installation 2\" class=\"wp-image-64205\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-4-1024x391.png 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-4-300x114.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-4-768x293.png 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-4.png 1180w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>Now, it&#8217;s time to create the all-important <strong>wp-config.php<\/strong> file. The information contained in it guarantees that WordPress connects to the database and works correctly. You can theoretically set it up with a text editor, but doing it with WP-CLI is easier.<\/p>\n\n\n\n<p><strong>Here&#8217;s the command:<\/strong><\/p>\n\n\n\n<p class=\"alert-orange\"><em>wp core config &#8211;dbhost=[the database host] &#8211;dbname=[the database&#8217;s name] &#8211;dbuser=[the MySQL user] &#8211;dbpass=[the database&#8217;s password<\/em><em>]<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-5.png\"><img decoding=\"async\" width=\"1024\" height=\"391\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-5-1024x391.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing WordPress and managing your installation 3\" class=\"wp-image-64206\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-5-1024x391.png 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-5-300x115.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-5-768x293.png 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-5.png 1200w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>With the wp-config.php file ready, you can install the core itself. The command is as follows:<\/p>\n\n\n\n<p class=\"alert-orange\"><em>wp core install &#8211;url=[the site&#8217;s URL] &#8211;title=[the site&#8217;s title] &#8211;admin_name=[the username you&#8217;ll use to access the WP dashboard] &#8211;admin_password=[the password for the admin account] &#8211;admin_email=[the admin email address]<\/em><\/p>\n\n\n\n<p class=\"alert-blue\"><strong>NOTE: <\/strong>If your site&#8217;s title consists of more than one word, you&#8217;ll need to put it in quotes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-6.png\"><img decoding=\"async\" width=\"1024\" height=\"388\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-6-1024x388.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing WordPress and managing your installation 4\" class=\"wp-image-64207\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-6-1024x388.png 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-6-300x114.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-6-768x291.png 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-6.png 1196w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>That&#8217;s it! WordPress is installed, and you can start working on your site.<\/p>\n\n\n\n<p>Once it&#8217;s up and running, you can use WP-CLI to perform other tasks related to the WordPress core. Among other things, you can:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Check for updates:<br><strong><em>wp core check-update<\/em><\/strong><\/li>\n\n\n\n<li>Update the core:<br><strong><em>wp core update<\/em><\/strong><\/li>\n\n\n\n<li>Launch WP&#8217;s database update procedure:<br><strong><em>wp core update-db<\/em><\/strong><\/li>\n\n\n\n<li>Convert an existing installation into a multisite installation:<br><strong><em>wp core multisite-convert<\/em><\/strong><\/li>\n\n\n\n<li>Set up a WP multisite installation from scratch:<br><strong><em>wp core multisite-install<\/em><\/strong><\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"users\"><strong>Creating and managing users<\/strong><\/h3>\n\n\n\n<p>You can use WP-CLI to determine who has access to your site and dashboard. With the <strong>wp user list<\/strong> command, you will see a list of all the users currently registered on your website.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-7.png\"><img decoding=\"async\" width=\"1024\" height=\"384\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-7-1024x384.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Creating and managing users\" class=\"wp-image-64208\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-7-1024x384.png 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-7-300x112.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-7-768x288.png 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-7.png 1196w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>We can, of course, add new users to the list. Here, for example, is the command we&#8217;ll use to set up a user with the username &#8220;Alice&#8221; (we&#8217;ll assume her email address is &#8220;alice@domain.com&#8221;) and a role as an author.<\/p>\n\n\n\n<p class=\"alert-orange\"><em>wp user create Alice alice@domain.com &#8211;role=author<\/em><\/p>\n\n\n\n<p>WP-CLI will automatically generate a password for Alice and display it on the screen.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-8.png\"><img decoding=\"async\" width=\"1024\" height=\"388\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-8-1024x388.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Creating and managing users 2\" class=\"wp-image-64209\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-8-1024x388.png 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-8-300x114.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-8-768x291.png 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-8.png 1188w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>If you want to set the password yourself, you can use the <strong>&#8211;user_pass= <\/strong>parameter.<\/p>\n\n\n\n<p><strong>You can also use it if you need to assign a new password to one of your existing users. Here&#8217;s the command you&#8217;ll need to change Alice&#8217;s password:<\/strong><\/p>\n\n\n\n<p class=\"alert-orange\"><em>wp user update Alice &#8211;user_pass=[the password you&#8217;ve chosen for the account]<\/em><\/p>\n\n\n\n<p><strong>If you want to change Alice&#8217;s role to administrator, you&#8217;ll need a slightly different command:<\/strong><\/p>\n\n\n\n<p class=\"alert-orange\"><em>wp user set-role Alice administrator<\/em><\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-9.png\"><img decoding=\"async\" width=\"1024\" height=\"387\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-9-1024x387.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Creating and managing users 3\" class=\"wp-image-64210\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-9-1024x387.png 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-9-300x113.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-9-768x290.png 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-9.png 1190w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"and\"><strong>Installing and managing plugins<\/strong><\/h3>\n\n\n\n<p>Plugins are a core part of every WordPress project, and managing them correctly is absolutely critical. With WP-CLI, you can <strong>install, activate, update, and delete plugins<\/strong> with easy-to-remember commands.<\/p>\n\n\n\n<p>Because we have no GUI to work with, the <strong>wp plugin list <\/strong>command could be handy. It displays all the installed plugins along with their versions, status, and available updates.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-10.png\"><img decoding=\"async\" width=\"870\" height=\"430\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-10.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing and managing plugins\" class=\"wp-image-64211\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-10.png 870w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-10-300x148.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-10-768x380.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>As you can see from the screenshot above, the <strong>Akismet<\/strong> and <strong>Hello Dolly<\/strong> plugins are installed but not activated. With WP-CLI, you can start using them both with the following command:<\/p>\n\n\n\n<p><strong>wp plugin activate hello akismet<\/strong><\/p>\n\n\n\n<p>You can also confirm that we have successfully activated them with the <strong>wp plugin list<\/strong> command.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-11.png\"><img decoding=\"async\" width=\"876\" height=\"435\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-11.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing and managing plugins 2\" class=\"wp-image-64213\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-11.png 876w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-11-300x149.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-11-768x381.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p><strong>To deactivate a plugin, use:<\/strong><\/p>\n\n\n\n<p class=\"alert-orange\"><em>wp plugin deactivate [the plugin&#8217;s name]<\/em><\/p>\n\n\n\n<p>Installing new plugins from <strong>WP&#8217;s official directory<\/strong> may seem like a bit more effort, but once you get the hang of it, you&#8217;ll see that there&#8217;s nothing too tricky about it.<\/p>\n\n\n\n<p>To install a plugin, you&#8217;ll need its <strong>slug<\/strong>. Often, the slug is the plugin&#8217;s name, and if it consists of multiple words, they&#8217;re connected by dashes.<\/p>\n\n\n\n<p>If you&#8217;re not sure what the plugin&#8217;s slug is, you can find it thanks to <strong>WP-CLI&#8217;s ability to search <\/strong>the official WordPress directory. Let&#8217;s search for &#8220;classic&#8221; and see what sort of results we&#8217;ll get:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-12.png\"><img decoding=\"async\" width=\"882\" height=\"461\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-12.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing and managing plugins 3\" class=\"wp-image-64214\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-12.png 882w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-12-300x157.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-12-768x401.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>All the plugins that match our criteria appear alongside their slugs and ratings.<\/p>\n\n\n\n<p><strong>We&#8217;re now sure what the slug is, so we can install the Classic Editor plugin with the following command:<\/strong><\/p>\n\n\n\n<p class=\"alert-orange\"><em>wp plugin install classic-editor<\/em><\/p>\n\n\n\n<p>So far, so straightforward, but one of WP-CLI&#8217;s most convenient features is the ability to install multiple plugins at once.&nbsp;<\/p>\n\n\n\n<p><strong>For example, if you want to install the Jetpack plugin alongside the Classic Editor, you can use:<\/strong><\/p>\n\n\n\n<p class=\"alert-orange\"><em>wp plugin install classic-editor jetpack<\/em><\/p>\n\n\n\n<p>Adding the <strong>&#8211;activate <\/strong>parameter will automatically enable them after the installation.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-13.png\"><img decoding=\"async\" width=\"886\" height=\"465\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-13.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing and managing plugins 4\" class=\"wp-image-64215\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-13.png 886w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-13-300x157.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-13-768x403.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>If you need to update a plugin, you can use the <strong>wp plugin update<\/strong> command followed by the plugin&#8217;s slug. The <strong>&#8211;all <\/strong>parameter updates all your plugins.<\/p>\n\n\n\n<p>Using the same principle, you can use the <strong>wp plugin uninstall<\/strong> command to uninstall plugins. Bear in mind that this command will only work if the plugin is deactivated.<\/p>\n\n\n\n<p>With the <strong>wp plugin delete<\/strong> command, you can delete plugins regardless of their status.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"themes\"><strong>Installing and managing themes<\/strong><\/h3>\n\n\n\n<p>If you get the hang of managing plugins via WP-CLI, you&#8217;ll have absolutely no problems taking care of your themes, as well. The principles are pretty much identical.<\/p>\n\n\n\n<p>The <strong>wp theme list<\/strong> command tells you which themes you have installed and which one is currently active. Note that you can&#8217;t have more than one active theme at the same time.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-14.png\"><img decoding=\"async\" width=\"877\" height=\"461\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-14.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing and managing themes\" class=\"wp-image-64216\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-14.png 877w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-14-300x158.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-14-768x404.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>You can search through WP&#8217;s official directory with the <strong>wp theme search <\/strong>command, and just like you did with plugins, you&#8217;ll use a slug to install a theme with <strong>wp theme install<\/strong>.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-15.png\"><img decoding=\"async\" width=\"871\" height=\"452\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-15.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Installing and managing themes 2\" class=\"wp-image-64217\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-15.png 871w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-15-300x156.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-15-768x399.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>If this is the theme you want to use, the <strong>&#8211;activate <\/strong>parameter saves some time. Themes can be updated via <strong>wp theme update<\/strong>, and <strong>wp theme uninstall <\/strong>and <strong>wp theme delete<\/strong> are analogous to the commands for plugins discussed in the previous section.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"comments\"><strong>Managing posts and comments<\/strong><\/h3>\n\n\n\n<p>WP-CLI may not be the most convenient method for <em>publishing, managing, and moderating posts<\/em> and comments, but it pays to know that it exists as an option.<\/p>\n\n\n\n<p>Once again, you have commands for listing all available posts and comments: <strong>wp post list <\/strong>and <strong>wp comment list<\/strong>, respectively. You also have a range of parameters you can use to filter the displayed results.<\/p>\n\n\n\n<p>For example, if you add <strong><em>&#8211;post_status=draft<\/em><\/strong>, WP-CLI will list only the posts that have been saved as drafts, and if you add <strong><em>&#8211;comment_approved=0<\/em><\/strong>, the list you&#8217;ll see will consist of comments that haven&#8217;t been approved yet.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-16.png\"><img decoding=\"async\" width=\"880\" height=\"453\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-16.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Managing posts and comments\" class=\"wp-image-64218\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-16.png 880w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-16-300x154.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-16-768x395.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<p>To edit comments and posts, you&#8217;ll use the <strong>wp post update <\/strong>and <strong>wp comment update <\/strong>commands. So, if you want to change the status of a post and save it as a draft, you&#8217;ll need <strong>wp post update<\/strong> followed by the post ID or name and <strong>&#8211;post_status=draft<\/strong>. Similarly, if you want to approve a comment, you enter <strong>wp comment update<\/strong> followed by the comment ID<strong> <\/strong>and <strong>&#8211;comment_approved=1<\/strong>.<\/p>\n\n\n\n<p>You can create new posts with the <strong>wp post create <\/strong>command. You need to add the <strong>&#8211;post_title= <\/strong>parameter to set it up, and you have quite a few others to play with, including:<\/p>\n\n\n\n<p><strong>&#8211;post_author= <\/strong>followed by the user ID of the author<\/p>\n\n\n\n<p><strong>&#8211;post_content= <\/strong>for the content<\/p>\n\n\n\n<p><strong>&#8211;post_excerpt= <\/strong>for the short excerpt visible on the homepage<\/p>\n\n\n\n<p><strong>&#8211;post_type= <\/strong>to create a page (by default, the content is saved as a post)<\/p>\n\n\n\n<p><strong>&#8211;post_status= <\/strong>to publish the post immediately (by default, it&#8217;s saved as a draft)<\/p>\n\n\n\n<p>The <strong>wp comment create<\/strong> command follows the same logic, with the most important parameters being:<\/p>\n\n\n\n<p><strong>&#8211;comment_post_ID= <\/strong>followed by the ID of the post under which you want the comment<\/p>\n\n\n\n<p><strong>&#8211;comment_content= <\/strong>followed by the contents of the comment<\/p>\n\n\n\n<p><strong>&#8211;comment_author= <\/strong>followed by the username of the comment&#8217;s author<\/p>\n\n\n\n<p class=\"alert-blue\"><strong>NOTE<\/strong>: If the values you set on any of the parameters consist of more than one word, they need to be <strong>surrounded by quotes<\/strong>.<\/p>\n\n\n\n<p>If you need to create a dummy site with some sample data to test something, you can use the <strong>wp post generate <\/strong>and <strong>wp comment generate <\/strong>commands to create posts and comments in bulk. The parameter that needs to follow is <strong>&#8211;count=<\/strong>, which determines the number of posts or comments you want to generate.<\/p>\n\n\n\n<p>If you want to create 15 posts, for example, the command will look like this:<\/p>\n\n\n\n<p><strong>wp post generate &#8211;count=15<\/strong><\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-17.png\"><img decoding=\"async\" width=\"887\" height=\"462\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-17.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Managing posts and comments 2\" class=\"wp-image-64219\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-17.png 887w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-17-300x156.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-17-768x400.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"search\"><strong>WP-CLI search\/replace command<\/strong><\/h3>\n\n\n\n<p>WordPress is <strong>a domain-dependent application<\/strong>. For example, if you use Joomla, you can access the application via the server&#8217;s IP even if your domain isn&#8217;t pointed correctly. With WordPress, you either need to point to the domain or edit your computer&#8217;s <a href=\"https:\/\/www.scalahosting.com\/blog\/how-to-edit-your-hosts-file-windows-linux-and-macos-guide\/\">hosts file<\/a>.<\/p>\n\n\n\n<p>During installation, WordPress asks you for your site&#8217;s URL, which it enters into the database and later uses to build quite a few <strong>internal links<\/strong>. The more complex your website, the more internal links you have, and changing all of them could be a monumental task.<\/p>\n\n\n\n<p>And every now and again, you might need to change them. For example, if you install an SSL certificate and need to <strong>switch your URLs to HTTPS<\/strong>, all the internal links have to be updated. The same is true if you <strong>change your domain<\/strong>.<\/p>\n\n\n\n<p>WP-CLI has a quick and easy way of updating all database entries and setting a new site URL.<\/p>\n\n\n\n<p>Remember that WP-CLI&#8217;s search\/replace command <strong>edits entries in your database<\/strong>.<strong> I<\/strong>f you don&#8217;t get it exactly right, you could<strong> break your website<\/strong>.<\/p>\n\n\n\n<p>There is a <strong>&#8211;dry-run <\/strong>parameter which shows you exactly what sort of changes will be made, but it&#8217;s nevertheless a good idea to have a backup before you continue.<\/p>\n\n\n\n<p>The command itself is pretty simple. Let&#8217;s say you want to change your domain from &#8220;<em>domain.com<\/em>&#8221; to &#8220;<em>domain.net.<\/em>&#8221; What you need to enter is:<\/p>\n\n\n\n<p><em>wp search-replace &#8216;domain.com&#8217; &#8216;domain.net&#8217; &#8211;dry-run<\/em><\/p>\n\n\n\n<p>Because of the <strong>&#8211;dry-run<\/strong> parameter, WP-CLI will display the tables and columns containing your old domain <strong>without making any changes to them<\/strong>. If you don&#8217;t see anything out of the ordinary, you can rerun the command without the <strong>&#8211;dry-run<\/strong> parameter. WP-CLI will make the necessary corrections and set the new site URL.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-18.png\"><img decoding=\"async\" width=\"965\" height=\"885\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-18.png\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, WP-CLI search\/replace command\" class=\"wp-image-64220\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-18.png 965w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-18-300x275.png 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/wp-cli-18-768x704.png 768w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"plugins\"><strong>Plugins That Support WP-CLI<\/strong><\/h2>\n\n\n\n<p>Plugin developers know just how popular WP-CLI is with experienced website administrators, so many of them have implemented support for the command-line interface into their products.<\/p>\n\n\n\n<p>For example, if you use <strong>WooCommerce<\/strong>, the world&#8217;s most popular WP plugin for creating online shops, you can use WP-CLI to, among other things, <strong>add products<\/strong> in bulk and <strong>manage orders and clients<\/strong>.<\/p>\n\n\n\n<p>The makers of <strong>Jetpack<\/strong>, a plugin for improving your website&#8217;s security and performance, also give you quite a few WP-CLI options. You can use commands to <strong>check Jetpack&#8217;s status, change its settings, whitelist IPs, disconnect users<\/strong>, etc.<\/p>\n\n\n\n<p>If you find the command-line interface convenient, you could do worse than check your plugins and see if they too support WP-CLI. More often than not, information about this is available in the plugin&#8217;s documentation, and thankfully, it&#8217;s usually pretty detailed.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large mpg-gallery\"><a href=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/pexels-negative-space-34600-scaled.jpg\"><img decoding=\"async\" width=\"1024\" height=\"683\" src=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/pexels-negative-space-34600-1024x683.jpg\" alt=\"What is WP-CLI? A Beginner&#8217;s Guide, Plugins That Support WP-CLI\" class=\"wp-image-64221\" srcset=\"https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/pexels-negative-space-34600-1024x683.jpg 1024w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/pexels-negative-space-34600-300x200.jpg 300w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/pexels-negative-space-34600-768x512.jpg 768w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/pexels-negative-space-34600-1536x1024.jpg 1536w, https:\/\/www.scalahosting.com\/blog\/wp-content\/uploads\/2022\/02\/pexels-negative-space-34600-2048x1365.jpg 2048w\" sizes=\"(max-width: 361px) 660px, (max-width: 767px) 89vw, (max-width: 1000px) 54vw, (max-width: 1071px) 910px, 1140px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"conclusion\"><strong>Conclusion<\/strong><\/h2>\n\n\n\n<p>Even though we covered quite a few tasks that you can do with WP-CLI,<strong> we barely scratched the surface<\/strong>. The command-line interface is an incredibly powerful platform that plays an instrumental role in <strong>improving the workflow<\/strong> for many website administrators. You might find it a bit cumbersome at first, but getting used to working with it could save you a lot of time down the line, so be sure to give it a go.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\" id=\"faq\"><strong>FAQ<\/strong><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-do-i-use-wp-cli\"><strong>How do I use WP-CLI?<\/strong><\/h3>\n\n\n\n<p>WP-CLI can be <a href=\"https:\/\/www.scalahosting.com\/kb\/access-server-ssh\/\"><strong>accessed remotely via SSH<\/strong><\/a>. If your local computer runs Windows, you can use PowerShell, and if your machine is based on macOS or Linux, you can connect to the server via the Terminal. Once you&#8217;re logged in, you need to navigate to the directory where your website is located before you can start executing <strong>WP-CLI commands<\/strong>.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"is-wp-cli-safe\"><strong>Is WP-CLI safe?<\/strong><\/h3>\n\n\n\n<p>SSH, the protocol you use to access WP-CLI, employs a robust encryption mechanism to ensure the information flowing between your personal computer and the<strong> host server is well protected<\/strong>. As long as your password is strong enough, you can be pretty sure your website is safe.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"how-do-i-download-wordpress-via-the-command-line\"><strong>How do I download WordPress via the command line?<\/strong><\/h3>\n\n\n\n<p>You can use WP-CLI to install WordPress on your account. To do that, use the <strong>wp core download<\/strong> command to download WP&#8217;s files to your server. Next, you need to use the <strong>wp config<\/strong> command to create the wp-config.php file, and finally, you can set up your site using <strong>wp core install<\/strong>.<\/p>\n\n\n\n<p><script type=\"application\/ld+json\">\n    {\n      \"@context\": \"https:\/\/schema.org\",\n      \"@type\": \"FAQPage\",\n      \"mainEntity\": [{\n        \"@type\": \"Question\",\n        \"name\": \"How do I use WP-CLI?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"WP-CLI can be accessed remotely via SSH. If your local computer runs Windows, you can use PowerShell, and if your machine is based on macOS or Linux, you can connect to the server via the Terminal. Once you're logged in, you need to navigate to the directory where your website is located before you can start executing WP-CLI commands.\"\n        }\n      }, {\n        \"@type\": \"Question\",\n        \"name\": \"Is WP-CLI safe?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"SSH, the protocol you use to access WP-CLI, employs a robust encryption mechanism to ensure the information flowing between your personal computer and the host server is well protected. As long as your password is strong enough, you can be pretty sure your website is safe.\"\n        }\n      },{\n        \"@type\": \"Question\",\n        \"name\": \"How do I download WordPress via the command line?\",\n        \"acceptedAnswer\": {\n          \"@type\": \"Answer\",\n          \"text\": \"You can use WP-CLI to install WordPress on your account. To do that, use the wp core download command to download WP's files to your server. Next, you need to use the wp config command to create the wp-config.php file, and finally, you can set up your site using wp core install.\"\n        }\n      }]\n    }<\/script><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Although it enables people with no technical skills to build their own personal websites, WordPress was never targeted exclusively at &#8230;<\/p>\n","protected":false},"author":113,"featured_media":64196,"comment_status":"open","ping_status":"closed","sticky":false,"template":"single-cluster-wp.php","format":"standard","meta":{"_acf_changed":false,"_seopress_robots_primary_cat":"none","_seopress_titles_title":"","_seopress_titles_desc":"","_seopress_robots_index":"","footnotes":""},"categories":[3,39],"tags":[],"class_list":["post-64194","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-web-hosting-in-general","category-wordpress-hosting"],"acf":[],"_links":{"self":[{"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/posts\/64194","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/users\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/comments?post=64194"}],"version-history":[{"count":7,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/posts\/64194\/revisions"}],"predecessor-version":[{"id":73544,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/posts\/64194\/revisions\/73544"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/media\/64196"}],"wp:attachment":[{"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/media?parent=64194"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/categories?post=64194"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.scalahosting.com\/blog\/wp-json\/wp\/v2\/tags?post=64194"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}