Black Friday20% off ProPlans →
Back to Blog
Guide
November 24, 2026
4 min read

AI WordPress Theme Development: Build a Block Theme With Claude Code (and What to Check)

N
Nagaraj Dev
Plugin Developer & Creator

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 themeClassic theme
Design lives intheme.json, HTML templates, patternsPHP templates, CSS, the Customizer
Client edits layouts inthe Site Editorwidgets and the Customizer
Easy for AI to read and checkyes: mostly structured filesharder: logic spread across PHP
Where new WordPress features landyesmostly 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:

  1. 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.
  2. Fonts are self-hosted. Use fontFace in theme.json with 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 WPShipReady

The 12 checks before a client sees an AI-built theme

Copy this list. Each item is a common way AI-written themes go wrong.

  1. Output is escaped (esc_html, esc_attr, esc_url, wp_kses_post). AI forgets this more than anything else.
  2. Every function, handle and pattern slug is prefixed, so nothing collides with a plugin.
  3. No hard-coded URLs to your local site. Use home_url() and get_theme_file_uri().
  4. No "invalid content" warnings when each template is opened in the Site Editor.
  5. theme.json validates against its schema, and uses version 3.
  6. Contrast passes for every text and background pair, including buttons and links.
  7. Fonts load from the theme, not an external service.
  8. The first image isn't lazy-loaded; images further down are, with width and height set.
  9. The debug log is clean with WP_DEBUG_LOG on.
  10. WordPress coding standards pass: PHP_CodeSniffer with the WordPress ruleset.
  11. Real content fits: the longest headline and the shortest page both look right.
  12. 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

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.