LLM Prompts

WP-CLI Command Generator and Explainer

Generates WP-CLI commands from descriptions and explains their function.

The method

Use this prompt in ChatGPT. Input a description of the WordPress task you want to automate. The prompt will generate a WP-CLI command to accomplish it and explain the command’s function. Ideal for users familiar with WP but new to WP-CLI. Copy the generated command and use it inside your WP-CLI terminal.

The prompts

Prompt 1
I want to create a new WordPress user with the username 'testuser', email '[email protected]', and the role of 'author'. The password should be automatically generated. Also, I'd like to make it so it sends them an email.
Prompt 2
I need a WP-CLI command to search and replace all instances of 'old_text' with 'new_text' in the WordPress database, but I want to preview changes before applying them. Also show the different tables affected.
Prompt 3
Generate the commands to install and activate the 'woocommerce' plugin using WP-CLI. Also, I'd like to update all plugins.
Prompt 4
Create commands to export the WordPress database to a file named 'backup.sql' and import it from the same file.