basic-wp-cli-commands
Traducciones al EspañolEstamos traduciendo nuestros guías y tutoriales al Español. Es posible que usted esté viendo una traducción generada automáticamente. Estamos trabajando con traductores profesionales para verificar las traducciones de nuestro sitio web. Este proyecto es un trabajo en curso.
to try this guide for free.
Basic WP-CLI Commands
When managing a WordPress site, using the command line can make tasks quicker and easier. WP-CLI, or WordPress Command Line Interface, is a powerful tool that helps you manage your WordPress sites without using the web browser. Whether you’re looking to add a new user, change your password, or install plugins, here’s how you can do it using WP-CLI.
Code Server
Go to your My SiteBay site’s dashboard to try these out
If you aren’t on SiteBay, you need to install wp-cli first on your local machine
Installation (Non SiteBay Users)
Make sure you have it installed on your local development machine or hosting environment. You can install WP-CLI by following the instructions on the official website. (This is preinstalled on SiteBay Code Server)
Adding or Changing a User
Adding a New User
To add a new user to your WordPress site via WP-CLI, you can use the following command:
|
|
- Replace
<username>
with the desired username. - Replace
<email>
with the user’s email address. - Replace
<role>
with the appropriate user role (e.g.,administrator
,editor
,subscriber
).
Example:
|
|
Changing a User’s Role
If you need to change a user’s role, use this command:
|
|
- Replace
<username>
with the username of the user. - Replace
<role>
with the new role.
Example:
|
|
Changing Your Password
If you’ve forgotten your password or need to update it for security reasons, WP-CLI makes it simple.
|
|
- Replace
<username>
with your username. - Replace
<newpassword>
with your new password.
Example:
|
|
Installing Plugins
Installing plugins using WP-CLI is straightforward and can be faster than using the WordPress dashboard.
Install a Plugin
To install a plugin, you need to know its slug from the WordPress plugin repository.
|
|
- Replace
<plugin_slug>
with the slug of the plugin.
Example:
|
|
Activate a Plugin
After installing, you need to activate the plugin:
|
|
Example:
|
|
Summary
Learning the basics of WP-CLI can greatly reduce the time you spend managing your WordPress site. It gives you the ability to perform critical tasks directly from the command line—whether you’re managing users, changing passwords, or handling plugins. It’s a tool that, once mastered, can offer you a straightforward and efficient way to manage your site’s back-end.
This page was originally published on