Use a coding agent like Claude Code with WordPress's official agent skills, so it follows WordPress conventions. Let it test its own work in WordPress Playground, locally or through the Playground MCP server. Then review the code, run it on staging and check security before it reaches a live site. AI writes WordPress code fast, and the review is what makes it safe.
AI coding agents can write a WordPress block, a small plugin or a theme tweak in minutes. The problem is that WordPress has twenty years of conventions, and a model writing from memory mixes old patterns with new ones. You get a plugin that works on your laptop, skips a nonce check and stores settings in a way the next developer won't recognise. On a platform where plugins are where most vulnerabilities live, that matters.
WordPress has spent 2026 building the pieces that fix this: official agent skills that teach the conventions, Playground so an agent can test its own work, and an Abilities API so plugins can offer safe actions to AI. This guide puts them together into a working setup. It starts with which setup fits your work, explains each piece, then covers the checks before anything goes live and the questions of exposing abilities and submitting to the directory.
Which setup fits your work?
| You're building | Use | Watch out for |
|---|---|---|
| A block theme or custom blocks | Claude Code with WordPress agent skills, tested in Playground | Hard-coded styles instead of theme.json |
| A small plugin for one site | Claude Code, the plugin development skill, WP-CLI | Missing nonces and capability checks |
| A plugin for the directory | The same, plus a full review before submission | Directory guidelines and security review |
| Quick fixes on a client site | A staging copy, never the live site | Changes nobody can trace later |
| A site with Studio | The Build with WordPress plugin for Claude | Deploying before you've tested |
Who is this guide for?
It's for developers and technical owners who write WordPress code. If you want AI to manage content instead, read Claude for WordPress. If you want to connect AI to a live site, start with which WordPress MCP server to use.
This is WordPress's equivalent of Shopify's Dev MCP server. The difference is that WordPress spreads it across skills, Playground and local tools instead of one server.
The first piece of the setup is teaching the agent how WordPress expects code to be written.
What are WordPress agent skills?
WordPress agent skills are official bundles of instructions, checklists and scripts that teach AI coding assistants how WordPress is built. WordPress keeps them in its agent-skills repository on GitHub, for Claude, Copilot, Codex, Cursor and other assistants.1 Contributors generated the first versions from official Gutenberg and WordPress documentation with an AI model, then reviewed and edited them, and the repository says so.1
You add one with a single command, such as the plugin development skill.1 My entry on the agent skill explains the format. Without skills, a model writes WordPress code from memory, which is how you get outdated patterns.
Knowing the conventions is half the job. The agent also needs a way to see whether its code works.
How does the agent test its own code?
Give it WordPress Playground, so it can run WordPress and check its work while it writes. In January 2026 WordPress published wp-playground, an agent skill that runs WordPress through the Playground CLI. It gives an agent a fast, repeatable way to test its changes as it goes.2 It works with Claude Code, Codex and other agents, and needs Node.js and npm.2
How an AI coding agent should build for WordPress
There's also an MCP route. The @wp-playground/mcp package connects AI coding agents to a Playground site running in your browser.3 The server runs as a local process, and the connection stays on your machine, with token authentication at startup.3 In Claude Code you add it with one claude mcp add command.3
Playground covers testing. For local development and deployment, two more tools fill the gaps.
Where do Studio and WP-CLI fit?
Studio gives you a local site and deployment, and WP-CLI gives the agent a precise way to act on WordPress. Anthropic's plugin directory lists a Build with WordPress plugin for Claude. It works with WordPress Studio for previews and deployment, and includes skills for WooCommerce and Jetpack.4
WP-CLI is the quiet workhorse. An agent that can run wp commands can create users, change options, import content and run database updates without clicking through screens. Keep it pointed at local or staging sites.
With the agent writing and testing, the human part of the job moves to review.
What should you check before AI code goes live?
Check it the way you'd check code from a new hire. AI-generated code fails security tests often. In Veracode's October 2026 snapshot of 18 models, 38% of coding tasks given no security guidance still produced code with a known vulnerability.5 WordPress plugins are where most WordPress vulnerabilities live. Patchstack counted 11,334 new ones in 2025, and 91% were in plugins.6
The WordPress-specific checks:
- Capability checks. Every action checks
current_user_can()for the right capability. - Nonces. Every form and admin action verifies a nonce.
- Sanitise in, escape out. Input is sanitised on save, and output escaped on display.
- Prepared queries. Database queries use
$wpdb->prepare(). - No secrets in code. API keys go in options or environment settings, never in the plugin files.
- Performance. No heavy queries on every page load. Run the page weight checker before and after.
My guide to vibe-coded website security covers the broader checks, and vibe coding a website covers the build loop.
Reviewed code can do more than run on one site. It can also offer actions to AI clients.
Should your plugin expose abilities for AI?
Yes, if it does things an AI client might want to run. The WordPress Abilities API lets a plugin register named actions with inputs, outputs and permission checks. The MCP Adapter then makes them available to AI clients.7 WooCommerce already does this for products and orders.
Register only actions that are safe for an agent, add a permission check to each, and test them through the adapter before you release.
If the plugin is good enough to share, the last question is how AI fits into the directory process.
Can AI submit a plugin to the directory?
It can help prepare one, and the review stays the same. WordPress.org has a Plugin Directory MCP server. Plugins submitted through it go through the same review as plugins submitted through the web form.8 A faster submission doesn't mean a faster approval, so run your own checks first.
What does a safe AI build session look like?
Here's how a small plugin might come together with this setup. It's an illustration of the workflow, not a client project.
| Step | What happens | Who decides |
|---|---|---|
| 1. Brief | "A plugin that adds a delivery-date notice to WooCommerce product pages, set per category" | You |
| 2. Skills loaded | Plugin development and WooCommerce skills added to the agent | You |
| 3. First draft | The agent writes the plugin, with settings stored the WordPress way | Agent |
| 4. Self-test | The agent runs it in Playground, fixes two errors it finds | Agent |
| 5. Review | You check capabilities, nonces, sanitising, escaping and queries | You |
| 6. Staging | Install on a copy of the live site, test with real products | You |
| 7. Release | Deploy, note the version, keep the prompt and diff | You |
The agent does steps three and four in minutes. Steps five and six take longer, and they're the ones that keep the live store safe.
What mistakes should you avoid?
- Working on the live site. Every AI change goes to local or staging first, with a way to roll back.
- Skipping the skills. Without them, the agent writes WordPress from memory, including patterns WordPress moved away from years ago.
- Trusting the agent's own tests. Playground catches errors. It doesn't catch a missing permission check that only matters when someone attacks it.
- Exposing every function as an ability. Only safe, permission-checked actions belong in front of AI clients.
- Losing the trail. Keep the prompt, the diff and the version, so the next developer can see what changed and why.
If you're planning a WordPress build with AI and want someone to set up the workflow with your team, a 20-minute call is enough to see what fits. You'll leave knowing which skills and checks to start with. For the wider picture, see Claude for WordPress and WordPress MCP security.
Questions people ask
Can Claude Code write WordPress plugins?
Is there a WordPress MCP server for developers?
What is the wp-playground skill?
An official agent skill that runs WordPress through the Playground CLI, so a coding agent can test its own changes while it works.2
Is AI-written WordPress code safe?
Only after review. In Veracode's October 2026 tests, 38% of AI coding tasks produced code with a known vulnerability.5 Check capabilities, nonces, sanitising, escaping and queries on every change.
Should I let an AI agent edit my live WordPress site's code?
No. Work on a local or staging copy, keep changes in Git, and deploy only reviewed code. Live sites should get content changes through MCP, not code changes.
