Skip to content

Getting Started with WP-CLI

Posted on:December 8, 2022 at 02:30 PM

Description

WP-CLI is a command line interface for WordPress. It allows you to manage WordPress sites from the command line, which makes it easier and faster to perform common tasks. This guide will walk you through the basics of using WP-CLI to manage your WordPress sites.

Requirements

In order to use WP-CLI, you will need the following:

Installation

Before you can start using WP-CLI, you need to install it on your server. You can do this by running the following command:

curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar

Once the command has finished, you can make the file executable by running the following command:

chmod +x wp-cli.phar

You can then move the file to a directory that is in your PATH, such as /usr/local/bin.

Usage

Once WP-CLI is installed, you can start using it to manage your WordPress sites. You can do this by running commands in the terminal.

For example, you can use the wp core command to install WordPress. To do this, you need to run the following command:

wp core install --url=example.com --title=Example --admin_user=admin --admin_password=password [email protected]

This will install WordPress on the URL example.com with the title “Example”, and create an admin user with the username “admin”, password “password” and email address ”[email protected]“.

You can also use WP-CLI to manage plugins and themes. For example, you can use the wp plugin command to install a plugin. To do this, you need to run the following command:

wp plugin install plugin-name

This will install the plugin with the name “plugin-name”.

Conclusion

WP-CLI is a great way to manage your WordPress sites from the command line. It is easy to install, and provides a fast and efficient way to perform common tasks. With WP-CLI, you can install WordPress, manage plugins and themes, and much more.