With WP-CLI, you can perform various actions on your WordPress site directly from the command line. Below is a compilation of essential commands you can utilize for different tasks.
1. Install and Update WordPress
-
Download WordPress:
-
Download a Specific Locale Version:
-
Install WordPress:
(Replace the default values with your credentials.)
-
Test the Installation:
-
Update to the Latest Version:
2. Manage Themes and Plugins
Managing Themes:
-
List Installed Themes:
-
List Inactive Themes in CSV Format:
-
Activate a Theme:
-
Search for Themes:
-
Install and Activate a Theme:
-
Update All Themes:
Managing Plugins:
-
List Installed Plugins:
-
Install and Activate a Plugin:
-
Update All Plugins:
-
Deactivate and Uninstall a Plugin:
-
Activate an Inactive Plugin:
-
Delete a Plugin:
3. Create a Child Theme
Creating a child theme ensures your customizations are preserved during updates.
- Generate a Child Theme: (This creates a child theme based on the Twenty Twenty theme.)
4. Moderate Comments
You can efficiently manage comments using WP-CLI.
-
Add a New Comment:
-
List Approved Comments:
-
Delete a Comment:
-
Permanently Delete Multiple Comments:
5. Update WP-CLI
Keeping WP-CLI updated is crucial for optimal performance.
- Update WP-CLI:
If your version is not updated, you will be prompted to accept the installation.
By utilizing these commands, you can significantly enhance your productivity and perform tasks that are not readily available in the WordPress admin panel. WP-CLI is a powerful tool for both beginners and experienced developers alike.