All Collections
Best Practices for Prompting CodeWP to Generate Code
Best Practices for Prompting CodeWP to Generate Code
Updated over a week ago

In this article, we'll discuss best practices for prompting when using generative AI tools such as CodeWP. These guidelines will help you effectively communicate with the AI to create code snippets or entire plugins for WordPress.

CodeWP is a generative AI tool specifically designed for WordPress development. It utilizes large language models that are custom trained to ensure accuracy and relevance in the context of WordPress projects. To make the most out of CodeWP, it's crucial to understand how to request information from our AI.

Initial Prompt

The initial prompt sets up your project, so it's essential to be clear and detailed about what you want. For example, if you're creating a form plugin:

  1. Specify all required fields

  2. Describe what should happen after form submission

  3. Request an admin settings page

  4. Indicate desired styling options

Treat the initial prompt as if you were providing instructions to an expert developer who doesn't know your business or goals yet - give them all the necessary information they need.

Break down complex tasks into smaller steps while including everything upfront in one generation request (e.g., first create then style and add a form). This ensures better results from the AI-generated code.

Secondary Prompts

Once your initial prompt has been submitted and generated by CodeWP, there might still be room for improvement or additional features needed:

  1. Extend functionality: "Add more fields" or "Redo it in another way"

  2. Edit specific lines of code: Copy-paste problematic sections and ask for changes.

  3. Address error messages encountered during testing on staging sites (never test on production sites).

When using secondary prompts, continue treating communication like speaking with an online developer โ€“ provide clear details about desired outcomes.

Explaining Existing Code

If you have existing code that needs explanation or installation guidance:

  • Be explicit about which aspects require clarification.

  • Keep these requests simpler than primary or secondary prompts.

By following these prompting best practices, you can ensure smooth communication with CodeWP's generative AI and achieve the desired results for your WordPress projects. Remember to be specific, detailed, and treat the AI like an expert developer who needs guidance on your unique requirements.

In the editor, it is crucial to be as clear and upfront with the information as possible. Imagine you are addressing a highly skilled developer who may not be familiar with your specific needs. By effectively communicating your requirements, you can ensure that both parties have a mutual understanding and achieve desired outcomes.

Did this answer your question?