WordPress

How to Create a Custom WordPress Theme With AI

How to create a custom WordPress theme with AI: write the brief, generate the files, preview it privately, check phones, then go live safely. Real example.

By wptaskify TeamUpdated Oct 18, 20269 min read
How to Create a Custom WordPress Theme With AI

Quick answer

To create a custom WordPress theme with AI, describe your business, brand colours and the sections each page needs, let the AI write the theme files (style.css, functions.php, templates and CSS), preview the theme privately before visitors see it, check it on a phone, and only then activate it, keeping your old theme installed so you can switch back. A small business theme is usually a few hundred lines of code across 8 to 10 files.

What you get: a theme built for one business

A ready-made theme is designed for everyone, so you spend your time hiding sections, fighting its layout and adding plugins to get what you need. A custom theme is the opposite: it has exactly the sections your business uses and nothing else.

Here is the same WordPress site, a plumbing company, with the default Twenty Twenty-Five theme and with its custom theme, Northside. Same pages, same content; only the theme changed.

The same WordPress home page with the default Twenty Twenty-Five theme and with the custom Northside plumbing theme
Left: the default theme. Right: the custom theme. Same site, same content.

Custom theme, child theme or page builder?

  • Child theme: you like an existing theme and want to change parts of it. Smallest change, see our child theme guide.
  • Page builder (Elementor and others): you want to drag and drop each page yourself. Flexible, but heavier pages and you depend on the builder.
  • Custom theme: you want a specific design for the whole site, fast pages and no builder. This used to need a developer; AI now writes the code from a description.

What a WordPress theme is made of

A theme is just a folder in wp-content/themes. WordPress only needs two files to list it: style.css with a Theme Name header, and index.php. Everything else is up to you. The Northside theme has nine files and 280 lines of code:

File list of the Northside theme: style.css, functions.php, header.php, front-page.php, page.php, parts/reviews.php, footer.php, index.php and assets/main.css with line counts
The whole custom theme: nine files, 280 lines, plus six photos.

Step 1: Write the brief

The AI can only build what you describe. A good brief fits on half a page and covers:

  • The business: what you do, where, and for whom.
  • The one action you want from visitors: call, book, buy, get a quote. It goes in the header and the hero.
  • Brand: colours (hex codes if you have them), fonts, logo, the feel (calm, bold, premium).
  • Sections for the home page in order, for example hero, services, areas covered, reviews, call to action.
  • A site you like and what you like about it.

Step 2: Generate the theme files

From the brief, the AI writes each file. Ask for a classic PHP theme if you want simple, readable files like these, or a block theme (theme.json plus HTML templates) if you want to edit layouts in the Site Editor later. Either way, a few things must be in every theme, and they are worth checking in what the AI writes:

  • add_theme_support( 'title-tag' ) so WordPress and SEO plugins control the page title,
  • wp_head() in the header and wp_footer() in the footer, or plugins break,
  • registered menus, so you can edit navigation in Appearance, then Menus.
The real functions.php of the Northside theme with theme supports, menus and stylesheet loading
The start of the real functions.php: theme supports, menus, fonts and the stylesheet.

Step 3: Preview it privately

Never switch a live site to a theme you have not seen. WordPress has a private preview built in: under Appearance, then Themes, click Live Preview on the new theme. You see your real pages in the new design, and visitors keep seeing the old one until you click Activate & Publish.

WordPress Customizer previewing the Northside theme with the Activate and Publish button, while the live site still uses the old theme
The private preview: "Previewing theme: Northside". Nothing changes for visitors until you click Activate & Publish.

Step 4: Check it on a phone

Most visitors to a local business site are on a phone, and that is where generated code most often goes wrong. Our first version looked right on desktop, but at phone width the phone number in the header ran off the screen. One CSS rule fixed it: on small screens, show only the call icon, which is still a tap-to-call link.

Check at least: the header and menu, the main button, the hero text size, and that nothing scrolls sideways. Your browser's developer tools (F12, then the phone icon) let you try different widths.

The Northside theme on a phone before and after the fix: first the phone number is cut off, then only the call icon shows
Real screenshots at phone width, before and after the fix.

Step 5: Go live, with a way back

  1. Take a backup.
  2. Activate the theme, then click through the home page, a service page, the contact form and a blog post.
  3. Keep the old theme installed for a few weeks, so switching back is one click.
  4. Check menus and widgets: they are stored per theme, so some may need setting up again.

If a theme file ever has a PHP mistake, the site can go blank; our guide to the white screen of death covers the fix.

Doing it all from a chat with wptaskify

If your site is connected to Claude or ChatGPT through wptaskify, the AI does these steps on your site directly. create_theme makes the theme folder, write_theme_plugin_file writes each file (it checks PHP files for errors first and refuses a broken one, and backs up anything it replaces), preview_theme gives you the private preview link, and activate_theme switches the live site only when you say so. rollback_theme puts the previous theme back in one step. These tools need the wptaskify Pro add-on on a paid plan.

Example conversation: the AI creates a theme from a brief with create_theme and write_theme_plugin_file and shares a private preview with preview_theme
An example conversation with the real theme tools.

Honest limits of AI-made themes

  • You own the code. There are no automatic theme updates, so new features and fixes are changes you ask for.
  • Review before launch: phone layout, a menu that works on phones, colour contrast, image sizes and page speed.
  • Plugins with their own templates, such as WooCommerce, may need extra theme files to look right.
  • Keep it simple. A focused theme with a few sections is easier to get right, and to change later, than one that tries to do everything.

Frequently asked questions

Can AI create a WordPress theme?

Yes. From a written brief, AI can write the files a theme needs: style.css, functions.php, page templates and CSS. You should still preview it privately and check it on a phone before going live.

What files does a WordPress theme need?

Only style.css with a Theme Name header and index.php are required. Most themes also have functions.php, header.php, footer.php, page templates and a stylesheet.

Should I use a block theme or a classic theme?

A block theme lets you edit layouts later in the Site Editor. A classic PHP theme has simple, readable files and is easy to change through code or an AI. Both work in current WordPress.

How do I preview a new theme without changing my live site?

Go to Appearance, then Themes and click Live Preview on the new theme. Visitors keep seeing the current theme until you click Activate & Publish.

Will changing my theme hurt my SEO?

Not if your content, URLs and titles stay the same. Check that the new theme supports title-tag, keeps your headings, and loads fast. Take a backup first so you can switch back.

Build and preview a custom theme for your site with your AIBring your own Claude or ChatGPT. Nothing goes live without your approval.
Get started free

Your AI is ready to work.

Connect WPTaskify and turn conversations into real actions.

Start Free