{"id":37942,"date":"2022-11-07T07:00:21","date_gmt":"2022-11-07T15:00:21","guid":{"rendered":"https:\/\/dhblog.dream.press\/blog\/?p=37942"},"modified":"2026-07-31T20:57:46","modified_gmt":"2026-08-01T03:57:46","slug":"guide-to-wp-cli","status":"publish","type":"post","link":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/","title":{"rendered":"What Is the WordPress CLI (And How Can You Use It)?"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">As you get more comfortable <a href=\"https:\/\/www.dreamhost.com\/blog\/guide-to-developing-a-wp-theme\/\" target=\"_blank\" rel=\"noopener\">developing WordPress<\/a>, you\u2019ll want some tools that will help you complete your tasks quickly and efficiently. The WordPress admin dashboard is intuitive and comprehensive, but it can also be time-consuming to navigate.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">What if you want to manage your site more directly, with just a few easy commands? This is where the <a href=\"http:\/\/wp-cli.org\/\" target=\"_blank\" rel=\"noopener\">WordPress Command Line Interface (WP-CLI)<\/a> comes in handy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The WP-CLI is a tool that enables you to interact with your WordPress site directly by using commands in a text-based interface. It\u2019s also very comprehensive, with a wide variety of potential commands. Almost anything you can do on the back end of your site, you can do much faster using the WP-CLI.<\/p>\n\n\n\n<h2 id=\"h-an-introduction-to-the-wordpress-command-line-interface-wp-cli\" class=\"wp-block-heading\"><b>What is the WordPress CLI (WP-CLI)?<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>The WP-CLI is a tool that enables you to interact with your WordPress site directly by using commands in a text-based interface.<\/strong> Instead of clicking through admin menus, you type short commands to install WordPress, manage themes, plugins, and users, and update the software, and you can chain those commands into scripts that automate it all.<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1670\" height=\"452\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/wordpress-cli.jpg.webp\" alt=\"WordPress CLI\" class=\"wp-image-37958 lazyload\" data-srcset=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/wordpress-cli.jpg.webp 1670w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/wordpress-cli-300x81.jpg 300w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/wordpress-cli-1024x277.jpg 1024w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/wordpress-cli-768x208.jpg 768w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/wordpress-cli-1536x416.jpg 1536w, https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/wordpress-cli-600x162.jpg.webp 600w, https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/wordpress-cli-750x203.jpg.webp 750w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/wordpress-cli-100x27.jpg 100w\" data-sizes=\"(max-width: 1670px) 100vw, 1670px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1670px; --smush-placeholder-aspect-ratio: 1670\/452;\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">As the name suggests, this tool enables you to perform administrative tasks on your WordPress site using a <a href=\"https:\/\/www.learnenough.com\/command-line-tutorial\" target=\"_blank\" rel=\"noopener\">command line<\/a>. With this method, you can complete a task by simply typing in a line of code and hitting <i>Enter<\/i>.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Like most WordPress users, you\u2019re probably very familiar with the WordPress admin area. It works well, but it\u2019s not the only option for managing your site. Having a graphical interface is certainly preferable for some users. However, it does mean time spent navigating menus and waiting for pages to load: installing and activating a plugin through the dashboard takes a login, a couple of screens, and several clicks, while the WP-CLI does it in one typed line (wp plugin install user-switching &#8211;activate, for example).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The beauty of the WP-CLI is that it gives you direct control over your site. Most of what you can do in the WordPress admin dashboard, you can do with the WP-CLI, plus some things the admin can\u2019t do at all: a single command, wp transient delete &#8211;all, clears every leftover transient from your database. It\u2019s not nearly as complicated as you may fear, and there are <a href=\"https:\/\/www.codecademy.com\/learn\/learn-the-command-line\" target=\"_blank\" rel=\"noopener\">plenty of resources<\/a> available if you want to learn more about it.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To use the WP-CLI, you\u2019ll need to install it on your WordPress site. Let\u2019s look at this process in more detail now.<\/p>\n\n<h2 id=\"h-how-to-install-the-wp-cli-on-your-wordpress-website\" class=\"wp-block-heading\"><b>How to install WP-CLI on your WordPress website<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">If your site is <a href=\"https:\/\/www.dreamhost.com\/wordpress\/\" target=\"_blank\" rel=\"noopener\">hosted with DreamHost<\/a>, it will already have the <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/214693248\" target=\"_blank\" rel=\"noopener\">WP-CLI installed<\/a>. If you need to, however, you can also install this tool manually.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll first need to make sure that your environment is compatible, meaning that it conforms to the following specifications:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>A UNIX-like environment (macOS, Linux, FreeBSD, Cygwin)<\/li>\n\n\n\n<li>PHP 7.2.24 or later<\/li>\n\n\n\n<li>WordPress 4.9 or later (versions older than the latest WordPress release may have degraded functionality)<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s the whole list \u2014 per the <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/guides\/installing\/\" target=\"_blank\" rel=\"noopener\">official handbook<\/a>, WP-CLI has no additional requirements beyond those of WordPress itself. The current stable release is WP-CLI 2.12.0 (May 2025).<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That first point might be a problem for some users. The WP-CLI is made with UNIX-like environments in mind and has limited support for Windows. The simplest fix is the Windows Subsystem for Linux (WSL), which gives you a genuine Linux environment where the steps below work exactly as written. You can also <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/installing\/#installing-on-windows\" target=\"_blank\" rel=\"noopener\">install it natively on Windows<\/a>, but expect some extra setup.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/installing\/\" target=\"_blank\" rel=\"noopener\">install the WP-CLI<\/a> in one of the environments on the above list, you\u2019ll need to use <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/216041267\" target=\"_blank\" rel=\"noopener\">Secure Shell (SSH)<\/a> to download and configure the necessary files. First, you need to download the <i>wp-cli.phar<\/i> file to your root directory, using the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">curl -O https:\/\/raw.githubusercontent.com\/wp-cli\/builds\/gh-pages\/phar\/wp-cli.phar<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You should then check to make sure that the file is working, using another command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">php wp-cli.phar --info<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Next, you\u2019ll want to make the file executable, which will enable you to use the wp command. You\u2019ll also want to move it to another directory. This final command will perform both tasks:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">chmod +x wp-cli.phar\n\nsudo mv wp-cli.phar \/usr\/local\/bin\/wp<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">No sudo? No problem. The file just needs to be executable and live somewhere in your PATH (\/usr\/local\/bin is only an example). On shared hosting or any account without root access, create a bin folder in your home directory (mkdir -p ~\/bin), move the file there as ~\/bin\/wp, and add that folder to your PATH in ~\/.bash_profile. And if your host preinstalls WP-CLI (as DreamHost does), you can skip the download entirely: connect over SSH, cd into your site\u2019s directory, and start running wp commands, or point any command at your install with the &#8211;path parameter.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With that, the WP-CLI should now be successfully installed. You can test it by running the command wp &#8211;info. If everything works, you\u2019ll see information about your version of the WP-CLI displayed.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Two quick post-install upgrades will make daily use faster. First, <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/guides\/installing\/#tab-completions\" target=\"_blank\" rel=\"noopener\">tab completion<\/a>: WP-CLI ships with a completion script for Bash and Z shell. Download wp-completion.bash, source it from your ~\/.bash_profile, and your terminal will finish commands as you type. Second, a <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/references\/config\/\" target=\"_blank\" rel=\"noopener\">configuration file<\/a>: WP-CLI reads defaults from a wp-cli.yml file, so you can set options like your WordPress path once instead of retyping them with every command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">That\u2019s it! You\u2019re now ready to use this tool to manage your site more efficiently. Before we move on, however, let\u2019s run through some alternative methods of installation.<\/p>\n\n\n\n<div class=\"article-newsletter article-newsletter--gradient\">\n\n\n<h2>Get Content Delivered Straight to Your Inbox<\/h2><p>Subscribe now to receive all the latest updates, delivered directly to your inbox.<\/p><form class=\"nwsl-form\" id=\"newsletter_block_\" novalidate><div class=\"messages\"><\/div><div class=\"form-group\"><label for=\"input_newsletter_block_\"><input type=\"email\"name=\"email\"id=\"input_newsletter_block_\"placeholder=\"Enter your email address\"novalidatedisabled=\"disabled\"\/><\/label><button type=\"submit\"class=\"btn btn--brand\"disabled=\"disabled\"><span>Sign Me Up!<\/span><svg width=\"21\" height=\"14\" viewBox=\"0 0 21 14\" fill=\"none\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\">\n<path d=\"M13.8523 0.42524L12.9323 1.34521C12.7095 1.56801 12.7132 1.9304 12.9404 2.14865L16.7241 5.7823H0.5625C0.251859 5.7823 0 6.03416 0 6.3448V7.6573C0 7.96794 0.251859 8.2198 0.5625 8.2198H16.7241L12.9405 11.8535C12.7132 12.0717 12.7095 12.4341 12.9323 12.6569L13.8523 13.5769C14.072 13.7965 14.4281 13.7965 14.6478 13.5769L20.8259 7.39879C21.0456 7.17913 21.0456 6.82298 20.8259 6.60327L14.6477 0.42524C14.4281 0.205584 14.0719 0.205584 13.8523 0.42524Z\" fill=\"white\"\/>\n<\/svg>\n<\/button><\/div><\/form><\/div>\n<h2 id=\"h-alternative-ways-to-install-the-wp-cli\" class=\"wp-block-heading\"><b>Alternative ways to install the WP-CLI<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">As we alluded to earlier, there are actually several methods to install the WP-CLI. We won\u2019t detail all of them in this article. However, we\u2019ll list them out briefly and link to more information on each, so you can choose the technique that best suits your needs.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">You can use the following tools to install the WP-CLI on your site:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/installing\/#installing-via-composer\" target=\"_blank\" rel=\"noopener\">Composer<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/installing\/#installing-via-homebrew\" target=\"_blank\" rel=\"noopener\">Homebrew<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/guides\/installing\/#installing-via-docker\" target=\"_blank\" rel=\"noopener\">Docker<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/installing\/#installing-via-deb-package\" target=\"_blank\" rel=\"noopener\">.deb package<\/a><\/li>\n\n\n\n<li><a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/installing\/#using-a-custom-php-binary\" target=\"_blank\" rel=\"noopener\">A custom PHP binary<\/a><\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, you may want to get involved in developing the WP-CLI yourself. You can easily get involved with its development by using the <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/guides\/installing\/#installing-via-git\" target=\"_blank\" rel=\"noopener\">Git installation instructions<\/a>.<\/p>\n\n<h2 id=\"h-5-ways-to-use-the-wp-cli-to-manage-your-wordpress-site\" class=\"wp-block-heading\"><b>How to use WP-CLI: 7 essential commands<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">WP-CLI gives you direct command-line access to most WordPress administration tasks, plus some operations the dashboard doesn\u2019t offer. There are <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/\" target=\"_blank\" rel=\"noopener\">dozens of commands<\/a> you can use to manage nearly everything from comments to core updates. Plus, you can even create <a href=\"https:\/\/make.wordpress.org\/cli\/handbook\/commands-cookbook\/\" target=\"_blank\" rel=\"noopener\">custom commands<\/a>. (These days, an AI assistant can draft a WP-CLI one-liner or custom-command boilerplate for you, though you should review any generated command before running it on a live site.)<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">We\u2019re now going to look at just a few of the standard commands available to you. This is to give you an idea of how you can use WP-CLI to manage your site before you dig deeper into the rabbit hole of possibilities.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-1-install-and-update-wordpress\"><b>1. Install and update WordPress with WP-CLI<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The most fundamental task you can accomplish with the WP-CLI is to download and install WordPress on your site. The <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/core\/download\/\" target=\"_blank\" rel=\"noopener\">command for downloading WordPress<\/a> is simply:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp core download<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will download and extract WordPress in the current directory. You can also <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/core\/download\/#options\" target=\"_blank\" rel=\"noopener\">add additional parameters<\/a> to refine the download further. For example, the locale parameter determines which translation of WordPress will be used. This command will download the Brazilian Portuguese version of WordPress:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp core download --locale=pt_BR<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Once downloaded, you can install WordPress using <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/core\/install\/\" target=\"_blank\" rel=\"noopener\">the install command<\/a>. This command contains a number of parameters that configure the setup. Let\u2019s take a look at an example:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp core install --url=example.com --title=Example --admin_user=supervisor --admin_email=info@example.com --prompt=admin_password<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">As you can see, this is all fairly self-explanatory. Simply replace the example data in each parameter with your own values. One deliberate choice here: the &#8211;prompt=admin_password flag tells WP-CLI to ask for the admin password interactively instead of taking it in the command itself, which keeps it out of your shell history. (Omit the password entirely, and WP-CLI generates a random one.) To ensure that everything has worked as expected, you can use the following command to test the installation:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp core version<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will return the version number of your installation, proving that WordPress has been successfully installed! Now you can make sure it\u2019s updated with the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp core update<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If a newer version of WordPress is available, it will be downloaded and installed automatically after you run this command.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-2-manage-themes-and-plugins\"><b>2. Manage themes and plugins<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">There are many ways you can manage <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/theme\/\" target=\"_blank\" rel=\"noopener\">themes<\/a> and <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/plugin\/\" target=\"_blank\" rel=\"noopener\">plugins<\/a> using the WP-CLI, so let\u2019s look at some of the basic options now. First, you can use the list command to view a list of your themes or plugins. Using parameters, you can filter the display by items with a specific status (such as inactive) or a particular output format.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For example, if you want to <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/theme\/list\/\" target=\"_blank\" rel=\"noopener\">list all inactive themes<\/a> as a CSV list, you can use the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp theme list --status=inactive --format=csv<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/plugin\/install\/\" target=\"_blank\" rel=\"noopener\">install a plugin<\/a> by specifying its slug in the plugin directory, providing the path to a local file, or entering the URL for an external file. In this example, we\u2019re also going to activate the plugin at the same time:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp plugin install ..\/my-plugin.zip --activate<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">It\u2019s also easy to switch themes. On a single-site install, you can <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/theme\/activate\/\" target=\"_blank\" rel=\"noopener\">activate a theme<\/a> with one command (the similar <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/theme\/enable\/\" target=\"_blank\" rel=\"noopener\">wp theme enable<\/a> command applies only to multisite networks). In this example, we\u2019re activating Twenty Twenty-Five, the current default theme:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp theme activate twentytwentyfive<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">There\u2019s also a command for <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/plugin\/deactivate\/\" target=\"_blank\" rel=\"noopener\">deactivating a plugin<\/a>. In our example, we\u2019ll use this command to disable the Hello Dolly plugin. We\u2019ll also uninstall the plugin at the same time:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp plugin deactivate hello --uninstall<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, you can search the respective directories looking for a specific <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/plugin\/search\/\" target=\"_blank\" rel=\"noopener\">plugin<\/a> or <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/theme\/search\/\" target=\"_blank\" rel=\"noopener\">theme<\/a>. For instance, let\u2019s search for a theme containing the string \u201cphoto\u201d. We\u2019re also setting it to return three results instead of the default ten:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp theme search photo --per-page=3<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This will display the following table:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"1504\" height=\"410\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/table.png.webp\" alt=\"WordPress CLI query table\" class=\"wp-image-37956 lazyload\" data-srcset=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/table.png.webp 1504w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/table-300x82.png 300w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/table-1024x279.png 1024w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/table-768x209.png 768w, https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/table-600x164.png.webp 600w, https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/table-750x204.png.webp 750w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/table-100x27.png 100w\" data-sizes=\"(max-width: 1504px) 100vw, 1504px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 1504px; --smush-placeholder-aspect-ratio: 1504\/410;\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">As we mentioned, this is only a small taste of how you can manage themes and plugins using the WP-CLI. Hopefully, you\u2019re getting a sense of how useful this tool can be.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-3-create-a-child-theme\"><b>3. Create a child theme<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">By using <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/scaffold\/\" target=\"_blank\" rel=\"noopener\">the scaffold command<\/a>, you can generate a <a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-create-wordpress-child-theme\/\" target=\"_blank\" rel=\"noopener\">child theme<\/a> that includes the <i>functions.php<\/i> and <i>style.css<\/i> files. We recommend that you do this if you want to make changes to an existing theme. When you use a child theme, any customizations won\u2019t be lost after new software updates.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To do this, you\u2019ll simply need to specify the slug for the new <a href=\"https:\/\/www.dreamhost.com\/blog\/how-to-create-wordpress-child-theme\/\" target=\"_blank\" rel=\"noopener\">child theme<\/a>, and for the theme you\u2019re using as the \u201cparent.\u201d In this example, we\u2019re creating a child based on the Twenty Twenty-Five theme, and we\u2019re giving it the slug twentytwentyfive-child:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp scaffold child-theme twentytwentyfive-child --parent_theme=twentytwentyfive<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If the process is successful, you\u2019ll see a message that the child theme has been created. This will also include the path to its directory:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Success: Created '\/var\/www\/example.com\/public_html\/wp-content\/themes\/twentytwentyfive-child'.<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You\u2019ll now find the child theme in the specified directory, ready to be edited!<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-4-moderate-comments\"><b>4. Moderate comments<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Moderating and <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/comment\/\" target=\"_blank\" rel=\"noopener\">managing comments<\/a> is made a lot easier in the WP-CLI, which enables you to quickly create, delete, and edit them. There are many <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/comment\/#subcommands\" target=\"_blank\" rel=\"noopener\">comment subcommands<\/a> you can use, but let\u2019s look at some of the most basic options.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First, you can add a new comment. The following command will add a comment to a post with the post ID of 20, and specifies the contents and author:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp comment create --comment_post_ID=20 --comment_content=\"This is my comment\" --comment_author=\"author-name\"<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Before you manage existing comments, it can be helpful to get a current list. You can do this <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/comment\/list\/\" target=\"_blank\" rel=\"noopener\">with the list command<\/a>, and the results can be filtered in multiple ways. For example, using this command will return a table containing the comment ID and author name for the three most recent approved comments (to list the comments on a specific post, use the &#8211;post_id parameter instead):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp comment list --number=3 --status=approve --fields=ID,comment_author<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This is what the resulting table will look like:<\/p>\n\n\n<div class=\"wp-block-image\">\n<figure class=\"aligncenter\"><img decoding=\"async\" width=\"838\" height=\"414\" data-src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/cli-table.png.webp\" alt=\"WordPress CLI query table\" class=\"wp-image-37963 lazyload\" data-srcset=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/cli-table.png.webp 838w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/cli-table-300x148.png 300w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/cli-table-768x379.png 768w, https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/cli-table-600x296.png.webp 600w, https:\/\/www.dreamhost.com\/blog\/wp-content\/smush-webp\/2022\/11\/cli-table-750x371.png.webp 750w, https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/cli-table-100x49.png 100w\" data-sizes=\"(max-width: 838px) 100vw, 838px\" src=\"data:image\/svg+xml;base64,PHN2ZyB3aWR0aD0iMSIgaGVpZ2h0PSIxIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPjwvc3ZnPg==\" style=\"--smush-placeholder-width: 838px; --smush-placeholder-aspect-ratio: 838\/414;\" \/><\/figure>\n<\/div>\n\n\n<p class=\"wp-block-paragraph\">If you want to delete comments, you can do that by specifying the comment IDs individually, like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp comment delete 64<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">You can also delete multiple comments by separating each ID with a space. In this example, we\u2019re also using the force parameter, which permanently deletes comments instead of adding them to the trash bin:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp comment delete 5 22 64 --force<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">One word of caution: &#8211;force and other destructive flags don\u2019t ask twice. Before running bulk deletions on a live site, take a database backup with wp db export (covered next) or rehearse the operation on a staging copy first. With a little practice, you can work through your site\u2019s comments very quickly using WP-CLI commands.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-5-back-up-and-migrate-your-database\"><b>5. Back up and migrate your database<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Now for the commands developers lean on most. The <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/db\/export\/\" target=\"_blank\" rel=\"noopener\">wp db export<\/a> command dumps your database to a SQL file (your safety net before any risky change) and the first half of any migration:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp db export<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Run with no arguments, it creates a file named after your database plus the date and a random hash. Its counterpart, <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/db\/import\/\" target=\"_blank\" rel=\"noopener\">wp db import<\/a>, loads a SQL file back into a site, so together the pair covers backups, restores, and site moves.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The other migration essential is <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/search-replace\/\" target=\"_blank\" rel=\"noopener\">wp search-replace<\/a>, which searches every row in your database tables and swaps one string for another \u2014 the standard way to update URLs after moving a site to a new domain. Unlike a raw SQL query, it intelligently handles PHP serialized data. Rehearse the operation with the &#8211;dry-run flag first, which runs the whole search and shows a report without saving any changes:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp search-replace 'http:\/\/example.test' 'https:\/\/example.com' --dry-run<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Happy with the report? Run the same command again without &#8211;dry-run to apply it for real. (And yes: take a wp db export first.)<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-6-manage-users\"><b>6. Manage users<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/user\/\" target=\"_blank\" rel=\"noopener\">wp user<\/a> command manages users along with their roles, capabilities, and meta. Creating a new author takes one line, and WP-CLI generates a password for the account and prints it in the output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp user create bob bob@example.com --role=author<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Where wp user really shines is in bulk. wp user list shows every account at a glance, wp user import-csv creates users from a CSV file, and when someone leaves the team, you can delete their account and reassign their posts to a colleague in a single step:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp user delete 123 --reassign=567<\/pre>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-5-update-the-wp-cli\"><b>7. Update the WP-CLI<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">As with every aspect of WordPress, you should always make sure that the WP-CLI is up to date. Fortunately, this is very simple. All you need to do is run the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">wp cli update<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If your version is the most recent available, you will get a message confirming this. However, if a new version can be downloaded, you\u2019ll be prompted to accept the installation. If you select <i>yes<\/i>, the WP-CLI will be updated, and you\u2019ll see a confirmation message with the new version number (2.12.0 is the current stable release, published in May 2025):<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">Success: Updated WP-CLI to 2.12.0<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Whether you need sudo here depends on where the file lives: a root-owned \/usr\/local\/bin\/wp needs sudo wp cli update, while a phar in your own ~\/bin updates with the plain command.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">With that, you\u2019ve updated your installation of the WP-CLI.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">By now, you\u2019re beginning to see what you can accomplish using this simple interface. There\u2019s <a href=\"https:\/\/help.dreamhost.com\/hc\/en-us\/articles\/214693248\" target=\"_blank\" rel=\"noopener\">more to learn<\/a>, but you should be proud of how far you\u2019ve come already!<\/p>\n\n<h2 id=\"h-automate-wordpress-tasks-with-wp-cli\" class=\"wp-block-heading\"><b>Automate WordPress tasks with WP-CLI<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Here\u2019s the real payoff: every WP-CLI command is scriptable. Anything you can type once, you can drop into a shell script and run on a schedule or as part of a deployment. That\u2019s what separates the WP-CLI from being merely a faster admin dashboard.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A cron job is the simplest place to start. This crontab line moves into your site\u2019s directory and takes a nightly database backup at 3 a.m.:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">0 3 * * * cd ~\/example.com &amp;&amp; wp db export<\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The same idea scales up: a short bash script can chain any of the commands above across every site you manage, and a deploy script can run wp search-replace with &#8211;dry-run as a pre-flight check before changes go live. The official <a href=\"https:\/\/developer.wordpress.org\/cli\/commands\/search-replace\/\" target=\"_blank\" rel=\"noopener\">wp search-replace documentation<\/a> even ends its examples with a ready-made bash script for swapping production URLs to development ones.<\/p>\n\n\n\n<h2 id=\"h-faqs-about-wp-cli\" class=\"wp-block-heading\"><b>FAQs about WP-CLI<\/b><\/h2>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-what-is-wp-cli\"><b>What is WP-CLI?<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">WP-CLI is the official command-line interface for WordPress. It lets you install WordPress, manage themes, plugins, users, and databases, and automate maintenance tasks by typing commands over SSH instead of clicking through the admin dashboard.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-do-i-access-wp-cli\"><b>How do I access WP-CLI?<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Connect to your server over SSH, then change into your WordPress site\u2019s directory and run wp commands from there. If you\u2019re outside the site directory, add the &#8211;path parameter to point WP-CLI at your WordPress files.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-how-do-i-install-wp-cli\"><b>How do I install WP-CLI?<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Download the wp-cli.phar file with curl, check it with php wp-cli.phar &#8211;info, make it executable with chmod +x, and move it into a directory on your PATH. Then run wp &#8211;info to confirm the installation.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-is-wp-cli-preinstalled-on-dreamhost\"><b>Is WP-CLI preinstalled on DreamHost?<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. WP-CLI is installed on all DreamHost servers, so there\u2019s nothing to set up. Connect over SSH, move into your site\u2019s directory, and start running wp commands right away.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"h-does-wp-cli-work-on-windows\"><b>Does WP-CLI work on Windows?<\/b><\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Only partially. The officially supported environments are UNIX-like (macOS, Linux, FreeBSD, Cygwin), and native Windows support is limited. The Windows Subsystem for Linux (WSL) is the easiest route, since the standard Linux install steps work unchanged.<\/p>\n\n\n\n<h2 id=\"h-work-more-efficiently-with-the-wordpress-cli\" class=\"wp-block-heading\"><b>Work more efficiently with the WordPress CLI<\/b><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Speed, accessibility, and efficiency are all traits that any smart developer looks for in their tools. The WP-CLI offers all of these and more while enabling you to manage your WordPress site remotely. Using the WP-CLI, you can perform most of the actions possible in the WordPress admin, just much more quickly (once you\u2019ve had a bit of practice) \u2014 and you can script the routine ones so you don\u2019t have to perform them at all.<\/p>\n\n\n\n\n\n<div\n\tclass=\"article-cta-shared article-cta-small\"\n>\n    <div class=\"tr-img-wrap-outer jsLoading\"><img decoding=\"async\" class=\"js-img-lazy \" src=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/lazy-loading-transparent.webp\" data-srcset=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder.webp 1x, https:\/\/www.dreamhost.com\/blog\/wp-content\/themes\/blog2018\/assets\/img\/article-small-ad-cta-placeholder-x2.webp 2x\"  alt=\"Ad background image\" \/><\/div>\n\n\n\n\n  <div class=\"content-btm\">\n    <h2\n      class=\"h2--md\"\n    >\n      Do More with DreamPress\n    <\/h2>\n    <p\n      class=\"p--md\"\n    >\n      Upgrade to DreamPress, DreamHost\u2019s managed WordPress hosting, for fully managed performance, 1-click staging, free site migrations, daily backups, and 24\/7 support from in-house WordPress experts.\n    <\/p>\n\n            <a\n            href=\"https:\/\/www.dreamhost.com\/wordpress\/managed\/\"\n                        class=\"btn btn--white-outline btn--sm btn--round\"\n                                    target=\"_blank\"\n            rel=\"noopener noreferrer\"\n            >\n                            Check Out Plans                    <\/a>\n\n  <\/div>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>As you get more comfortable developing WordPress, you\u2019ll want some tools that will help you complete your tasks quickly and efficiently. The WordPress admin dashboard is intuitive and comprehensive, but it can also be time-consuming to navigate. What if you want to manage your site more directly, with just a few easy commands? This is [&hellip;]<\/p>\n","protected":false},"author":1062,"featured_media":37959,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_yoast_wpseo_opengraph-title":"WP-CLI: What Is It & How to Use It - DreamHost","_yoast_wpseo_opengraph-description":"WP-CLI is the WordPress command line tool that lets you manage your site fast \u2014 learn what it is, key commands, and how to install it.","_yoast_wpseo_twitter-title":"WP-CLI: What Is It & How to Use It - DreamHost","_yoast_wpseo_twitter-description":"WP-CLI is the WordPress command line tool that lets you manage your site fast \u2014 learn what it is, key commands, and how to install it.","toc_headlines":"[[\"h-an-introduction-to-the-wordpress-command-line-interface-wp-cli\",\"What is the WordPress CLI (WP-CLI)?\"],[\"h-how-to-install-the-wp-cli-on-your-wordpress-website\",\"How to install WP-CLI on your WordPress website\"],[\"h-alternative-ways-to-install-the-wp-cli\",\"Alternative ways to install the WP-CLI\"],[\"h-5-ways-to-use-the-wp-cli-to-manage-your-wordpress-site\",\"How to use WP-CLI: 7 essential commands\"],[\"h-automate-wordpress-tasks-with-wp-cli\",\"Automate WordPress tasks with WP-CLI\"],[\"h-faqs-about-wp-cli\",\"FAQs about WP-CLI\"],[\"h-work-more-efficiently-with-the-wordpress-cli\",\"Work more efficiently with the WordPress CLI\"]]","hide_toc":false,"show_updated_at":"1","footnotes":""},"categories":[13129,12852,696],"tags":[],"class_list":["post-37942","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developer-central","category-website-design","category-wordpress"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v28.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>WP-CLI: What Is It &amp; How to Use It - DreamHost<\/title>\n<meta name=\"description\" content=\"WP-CLI is the WordPress command line tool that lets you manage your site fast \u2014 learn what it is, key commands, and how to install it.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"WP-CLI: What Is It &amp; How to Use It - DreamHost\" \/>\n<meta property=\"og:description\" content=\"WP-CLI is the WordPress command line tool that lets you manage your site fast \u2014 learn what it is, key commands, and how to install it.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/\" \/>\n<meta property=\"og:site_name\" content=\"DreamHost Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/DreamHost\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-07T15:00:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-08-01T03:57:46+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/What-is-WordPress-CLI-Social.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Jason Cosper\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:title\" content=\"WP-CLI: What Is It &amp; How to Use It - DreamHost\" \/>\n<meta name=\"twitter:description\" content=\"WP-CLI is the WordPress command line tool that lets you manage your site fast \u2014 learn what it is, key commands, and how to install it.\" \/>\n<meta name=\"twitter:creator\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:site\" content=\"@dreamhost\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jason Cosper\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"9 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"WP-CLI: What Is It & How to Use It - DreamHost","description":"WP-CLI is the WordPress command line tool that lets you manage your site fast \u2014 learn what it is, key commands, and how to install it.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/","og_locale":"en_US","og_type":"article","og_title":"WP-CLI: What Is It & How to Use It - DreamHost","og_description":"WP-CLI is the WordPress command line tool that lets you manage your site fast \u2014 learn what it is, key commands, and how to install it.","og_url":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/","og_site_name":"DreamHost Blog","article_publisher":"https:\/\/www.facebook.com\/DreamHost\/","article_published_time":"2022-11-07T15:00:21+00:00","article_modified_time":"2026-08-01T03:57:46+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/What-is-WordPress-CLI-Social.jpg","type":"image\/jpeg"}],"author":"Jason Cosper","twitter_card":"summary_large_image","twitter_title":"WP-CLI: What Is It & How to Use It - DreamHost","twitter_description":"WP-CLI is the WordPress command line tool that lets you manage your site fast \u2014 learn what it is, key commands, and how to install it.","twitter_creator":"@dreamhost","twitter_site":"@dreamhost","twitter_misc":{"Written by":"Jason Cosper","Est. reading time":"9 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/#article","isPartOf":{"@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/"},"author":{"name":"Jason Cosper","@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/person\/696d1ca9f2e23c846e02e04944e8fca4"},"headline":"What Is the WordPress CLI (And How Can You Use It)?","datePublished":"2022-11-07T15:00:21+00:00","dateModified":"2026-08-01T03:57:46+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/"},"wordCount":2921,"publisher":{"@id":"https:\/\/www.dreamhost.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/What-is-WardPress-CLI-Feature-1.jpg","articleSection":["Developer Central","Website Design","WordPress"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/","url":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/","name":"WP-CLI: What Is It & How to Use It - DreamHost","isPartOf":{"@id":"https:\/\/www.dreamhost.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/#primaryimage"},"image":{"@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/What-is-WardPress-CLI-Feature-1.jpg","datePublished":"2022-11-07T15:00:21+00:00","dateModified":"2026-08-01T03:57:46+00:00","description":"WP-CLI is the WordPress command line tool that lets you manage your site fast \u2014 learn what it is, key commands, and how to install it.","breadcrumb":{"@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/#primaryimage","url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/What-is-WardPress-CLI-Feature-1.jpg","contentUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/11\/What-is-WardPress-CLI-Feature-1.jpg","width":900,"height":598,"caption":"WordPress CLI"},{"@type":"BreadcrumbList","@id":"https:\/\/www.dreamhost.com\/blog\/guide-to-wp-cli\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dreamhost.com\/blog\/"},{"@type":"ListItem","position":2,"name":"What Is the WordPress CLI (And How Can You Use It)?"}]},{"@type":"WebSite","@id":"https:\/\/www.dreamhost.com\/blog\/#website","url":"https:\/\/www.dreamhost.com\/blog\/","name":"DreamHost Blog","description":"","publisher":{"@id":"https:\/\/www.dreamhost.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dreamhost.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dreamhost.com\/blog\/#organization","name":"DreamHost","url":"https:\/\/www.dreamhost.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","contentUrl":"https:\/\/dhblog.dream.press\/blog\/wp-content\/uploads\/2019\/01\/dh_logo-blue-2.png","width":1200,"height":168,"caption":"DreamHost"},"image":{"@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/DreamHost\/","https:\/\/x.com\/dreamhost","https:\/\/www.instagram.com\/dreamhost\/","https:\/\/www.linkedin.com\/company\/dreamhost\/","https:\/\/www.youtube.com\/user\/dreamhostusa"]},{"@type":"Person","@id":"https:\/\/www.dreamhost.com\/blog\/#\/schema\/person\/696d1ca9f2e23c846e02e04944e8fca4","name":"Jason Cosper","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","url":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","contentUrl":"https:\/\/www.dreamhost.com\/blog\/wp-content\/uploads\/2022\/02\/IMG_4807-scaled.jpeg","caption":"Jason Cosper"},"description":"Jason is DreamHost\u2019s WordPress Product Advocate, based out of Bakersfield, CA. He is currently working on making our DreamPress product even better. In his free time, he likes to curl up on the couch and watch scary movies with his wife Sarah and three very small dogs. Follow him on Twitter.","url":"https:\/\/www.dreamhost.com\/blog\/author\/jasoncosper\/"}]}},"lang":"en","translations":{"en":37942,"de":54087,"pt":54080,"es":54132,"pl":54137,"ru":54141,"uk":54178,"it":68207,"fr":70013,"nl":70046},"pll_sync_post":{},"_links":{"self":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/37942","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/users\/1062"}],"version-history":[{"count":1,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/37942\/revisions"}],"predecessor-version":[{"id":86627,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/posts\/37942\/revisions\/86627"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/media\/37959"}],"wp:attachment":[{"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/media?parent=37942"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/categories?post=37942"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dreamhost.com\/blog\/wp-json\/wp\/v2\/tags?post=37942"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}