AI WordPress Theme Development: Build a Block Theme With Claude Code (and What to Check)
Search for an "AI WordPress theme generator" and you'll find tools that produce a theme in a minute. Download one, activate it, and it looks fine, until a client tries to change their opening hours, a contrast checker flags half the buttons, or the editor says "This block contains unexpected or invalid content."
AI is genuinely good at WordPress theme development now. It's just not good at checking its own work. This guide shows how to build a real block theme with AI (we use Claude Code), step by step, and the checks that turn a generated theme into one you can hand to a client.
Block theme or classic theme?
If you're starting fresh, build a block theme. It's what WordPress is built around now, and it suits AI particularly well:
| Block theme | Classic theme | |
|---|---|---|
| Design lives in | theme.json, HTML templates, patterns | PHP templates, CSS, the Customizer |
| Client edits layouts in | the Site Editor | widgets and the Customizer |
| Easy for AI to read and check | yes: mostly structured files | harder: logic spread across PHP |
| Where new WordPress features land | yes | mostly no |
Choose classic only if the site depends on something that still needs it.
The anatomy of a block theme
Everything AI has to produce, and everything you have to check:
style.css: the theme header (name, version, text domain). Barely any CSS.theme.json(version 3): colours, fonts, font sizes, spacing, layout widths and styles for every element and block. This is the design system.templates/:index.html,front-page.html,page.html,single.html,404.html,search.html, written in block markup.parts/:header.html,footer.html.patterns/: one PHP file per reusable section (hero, services, testimonials, contact), with a header and translatable text.functions.php: only what blocks can't do.
Step 1: Design system first, theme second
Most AI-generated themes go wrong here: they start with the homepage. Start with theme.json instead.
Give Claude Code the brand (hex colours, fonts, spacing scale, content and wide widths) and ask for theme.json only. Then check two things before anything else:
- Contrast. Every text colour on its background needs a ratio of at least 4.5:1 for body text. Ask the AI to calculate and list each pair. Fixing a colour now costs a minute; after the build it means touching every template.
- Fonts are self-hosted. Use
fontFaceintheme.jsonwith the font files inside the theme, not a call to Google Fonts on every page load.
Step 2: Templates and parts, one at a time
Ask for the header and footer parts, then one template per request. After each:
- open it in the browser at phone, tablet and desktop widths
- open it in the Site Editor too: if any block shows "This block contains unexpected or invalid content", the block markup doesn't match what the block expects, and the client will hit it the first time they edit
- check the debug log has nothing new
AI can't see your screen. When the layout's off, send a screenshot with one specific sentence ("the menu overlaps the logo below 400px"). That beats three paragraphs of description.
Step 3: Patterns with real content
Patterns are where clients actually work, so build them with the client's real text from the content plan, never lorem ipsum. Real headlines are longer than placeholder ones, and they break layouts that looked perfect in the mock-up.
Each pattern file needs a proper header (Title, Slug as theme/name, Categories) and translatable, escaped strings:
<?php
/**
* Title: Services
* Slug: acme/services
* Categories: acme
*/
?>
<!-- wp:heading -->
<h2 class="wp-block-heading"><?php echo esc_html__( 'What we do', 'acme' ); ?></h2>
<!-- /wp:heading -->
Step 4: Use the Create Block Theme plugin for the last mile
The official Create Block Theme plugin saves changes made in the Site Editor back into the theme's files. That's the best of both worlds: AI builds the structure, you polish spacing and alignment visually in the editor, then save it into the theme so it's in version control and not just in the database.
Build block themes with checks after every step
WPShipReady's build phase does this in Claude Code: theme.json from an approved design system, one template or pattern at a time, the debug log read after each, and the WordPress coding standards checked as it goes.
See WPShipReadyThe 12 checks before a client sees an AI-built theme
Copy this list. Each item is a common way AI-written themes go wrong.
- Output is escaped (
esc_html,esc_attr,esc_url,wp_kses_post). AI forgets this more than anything else. - Every function, handle and pattern slug is prefixed, so nothing collides with a plugin.
- No hard-coded URLs to your local site. Use
home_url()andget_theme_file_uri(). - No "invalid content" warnings when each template is opened in the Site Editor.
theme.jsonvalidates against its schema, and uses version 3.- Contrast passes for every text and background pair, including buttons and links.
- Fonts load from the theme, not an external service.
- The first image isn't lazy-loaded; images further down are, with width and height set.
- The debug log is clean with
WP_DEBUG_LOGon. - WordPress coding standards pass: PHP_CodeSniffer with the WordPress ruleset.
- Real content fits: the longest headline and the shortest page both look right.
- The client can edit what they need, logged in with their own role, without breaking the layout.
Then test the finished site from the outside. Our free WordPress launch check runs speed, accessibility, SEO and security checks on any live site, and here's a real QA report from a live site to show what the full version looks like.
Do AI WordPress theme builders replace this?
Hosted AI theme builders are great for a first draft or a personal site. For client work, the questions that matter are the same whatever made the theme: Is it accessible? Is it fast? Can the client edit it without breaking it? Is the code safe? A generator can't answer those. A process with real checks can.
Which of the 12 checks has caught the most problems in your AI-built themes?
Frequently asked questions
Yes. Both can write a block theme's files. The difference with an agent like Claude Code is that it works inside your project, so it can create the files, activate the theme with WP-CLI, read the debug log and fix what it finds.
It depends on the job. For quick drafts, hosted generators. For client sites you'll maintain, an AI coding agent working to your design system and checklist, so you own clean, standard block theme code.
Yes. AI makes you faster, but you're still the one who knows what good looks like, and who signs off on what goes to the client.
Related Articles
Claude Code for WordPress Development: A Workflow From Client Brief to Launch (2026)
How to use Claude Code for WordPress development without the chaos: CLAUDE.md rules, plan mode, skills, MCP and plugins, approval gates, and real checks, in a workflow that goes from client brief to launch report.
How to Test WordPress Plugin Compatibility (and Find Conflicts) Before They Break a Live Site
A step-by-step way to check WordPress plugin compatibility with your WordPress and PHP versions, test plugins locally, find plugin conflicts, and measure what each plugin costs in speed, before it reaches a client's live site.
Website Handover Checklist and Document Template (Free) for WordPress Sites
What a website handover should include, the handover process step by step, and a free website handover document template you can copy, edit and send to your client.
Import your first Word document in under 60 seconds
Start free. Import a Word document without copy-pasting or rebuilding its formatting. No account, no credit card. Straight from WordPress.org.