The method
Use this prompt in ChatGPT or Gemini. Provide the desired WP-CLI task. The LLM will provide equivalent commands, flags, and alternative approaches. Perfect for users migrating or learning WP-CLI, paste your command in a message.
The prompts
Prompt 1
I want to understand the different ways I can manage WordPress plugins via WP-CLI. Can you show me how to install, activate, deactivate, update, and delete a plugin called 'Akismet' using WP-CLI commands? Also, for each command, could you provide alternative command structures or flags that accomplish the same result? Explain each option briefly.
Prompt 2
I am looking to manage WordPress users effectively using WP-CLI. Show me the WP-CLI commands for creating a new user with the username 'john_doe', setting their email to '[email protected]', and assigning them the 'editor' role. Additionally, show me how to update an existing user's email address and reset their password. Explain the usage and effect of any flags you include.
Prompt 3
I need help optimizing my WordPress database using WP-CLI. Show me the WP-CLI commands for cleaning up the database, such as removing transient options, optimizing tables, and repairing the database. Also, detail any flags that can be used to customize these processes and any potential risks associated with each command. Furthermore, explain how to schedule these operations to be performed regularly using WP-CLI and system cron jobs.
Prompt 4
Explain how to manage WordPress themes using WP-CLI. Can you demonstrate how to install a theme from the WordPress.org repository, activate a theme, and delete a theme? Explain how to list all installed themes (active and inactive). Finally, show how to update all installed themes.
Prompt 5
I want to export and import my WordPress database and files using WP-CLI. Provide the commands and flags necessary to create a full backup of my WordPress site (database and files). Then, provide the commands for importing both the database and files to a new WordPress installation.