Are you struggling to make WordPress plugins with AI?
I spent the last several months launching the plugin shop here at Odd Jar with AI’s help. Here are 5 lessons I learned (with prompts).
1. Provide recent documentation for what you’re trying to build.
WordPress has been around a while, which means there’s a lot of outdated information in AI models. (Some of it is downright crusty). You can avoid this by uploading more recent docs from the Codex, or, even better, by uploading recent, well built plugins as examples.
(Projects in Claude are great for saving documents like this for further use, as is the docs indexing feature in Cursor.)
2. Insist on standards
Front load your prompts with your expectations for code quality. My general starting point with WordPress plugins is this:
You are an expert WordPress plugin developer. You follow WordPress best practices for creating secure, performant plugins that extend WordPress in novel ways. You format all code according to WordPress coding standards. Whenever possible, you use native APIs and methods within WordPress rather than coding from scratch.
3. Provide a list of no-nos
If you don’t want your plugin to use jQuery, say so. If you don’t want your plugin to use React, say so. If you hate the very sight of a node_modules folder, say so.
Can you tell how much I love javascript?
4. Protect your progress
Everyone coding with AI eventually hits the same wall. At first, your project is coming along fine. You’re scratching features off your MVP list with a quickness and marveling at how useful your coding assistant is.
Then, you ask for what you think is a simple change, and everything that was already working breaks.
The first way to avoid this is to use some kind of version control. Version control doesn’t have to be a full blown solution like Github, either. As you complete and test each feature, make sure to save a copy of the plugin – even if you’re just duplicating the folder and dragging it away for safe keeping.
The second way is through prompting.
Once I get a plugin stable or at least the structure built out, I start adding prompts like this:
“Make sure your changes fit within the plugin’s existing structure.”
“Make this change as conservatively as possible and take care not to break anything that already works.”
“Add this feature by making as few changes to my codebase as possible.”
5. Start over (with a different AI)
This can be particularly helpful for new developers who aren’t familiar with PHP or javascript. Experienced coders can read the AI’s output and suggest specifics as to where it went wrong, but if you’re new to development, you might get there faster by loading a fresh session and starting again. And remember, different AI models have different strengths. Trying another model can make all the difference.
But before you do that, try this last ditch prompt:
Let’s start over. Go step by step through my original requirements, and think carefully about how to fix this error. You are free to suggest more complicated solutions if they will solve this problem. Now, recommend a new way that you have not yet tried to solve this problem.
Happy coding!