The method
Use this prompt directly in ChatGPT, Gemini or Claude. Input the desired WordPress task and the prompt will generate the corresponding WP-CLI command and explain its function. This works best when you have a specific task in mind or need help understanding an existing command.
The prompts
Prompt 1
I need a WP-CLI command to search all WordPress posts for the phrase 'example keyword' and replace it with 'new keyword'. Show me the command and explain what each part does. Include flags for case-insensitive matching and a confirmation prompt before each replacement.
Prompt 2
Can you give me the WP-CLI command to export my entire WordPress database, compress it into a gzip file, and save it with a filename containing the current date? Explain each parameter and the purpose of any flags used. The goal is a backup command. And also how to import the DB.
Prompt 3
I want to create a new WordPress user with the username 'tester', email address '[email protected]', and the role of 'editor' using WP-CLI. Please provide the command and explain each option I'm using. Also explain how to set a password via WP CLI
Prompt 4
I need to update all installed WordPress plugins to their latest versions using WP-CLI. What is the command? Also, can you add a step to backup all the plugins before the update occurs for safety reasons? Explain each part of the command, including any relevant flags.