AI will happily edit your theme, and sometimes (rarely!) quietly wreck it. It answers with the same confidence whether the code is right or wrong. If you cannot read the output, the first sign of a mistake is often a broken page.
The themes behind this post are mine. I build and sell them under Themnific and Dannci. I know the codebase well, so the failure patterns below come from knowing where AI-written code tends to go wrong in a theme like this. A reviewer with no stake in a theme would be a fairer judge, so read my examples with that in mind.
This post is not a sales pitch, and it is not a benchmark with measured scores. It is a task-by-task guide to what suits AI, what does not, and how to check the output before it reaches your site. The tool in mind throughout is Claude AI, though the same habits apply to other assistants. Model behaviour changes between releases, so run your own small test before you trust any assistant with a bigger job.
Test setup
The advice here assumes a classic theme, meaning one built from PHP template files, running alongside the free Elementor plugin. Block themes handle customisation differently, and Section 5 covers where that causes confusion. Run every experiment on a staging copy of your site with a fresh backup, never on the live site.
Decide in advance what you will give the AI. The options are the theme file in question, a screenshot of the problem, a plain-English description, or all three. Each added input narrows the guesswork, and a pasted file does the most.
Score each result on four levels so you can compare tasks honestly:
- Worked first try: the output did what you asked with no edits.
- Worked after correction: you had to fix it or re-prompt before it behaved.
- Broke something: the change worked but damaged another part of the site.
- Dangerous: the output created a security or data risk.
Before you start: the safe-customisation baseline
Create a child theme first. A child theme holds your edits in a separate folder, so a parent theme update does not erase them. Skipping it is the most common reason customisations vanish after an update.
Work on a staging site with a full backup taken before the first edit. If you can, put the child theme under version control such as Git, so you can see every change and roll it back. A folder of dated copies is a weaker substitute, but it still beats nothing.
One rule covers the rest: never paste AI output straight into the parent theme or into functions.php on a live site. A single missing bracket in functions.php can take the whole site down.
What AI handles well
CSS tweaks
Contained visual changes are the safest place to start. Colours, spacing, typography, hover states, and responsive fixes all fit. A typical prompt reads: “Here is my button CSS from this theme. Add a darker background on hover and a 0.2 second transition. Change nothing else.”
The reply should be a few lines, such as a :hover rule with a darker background-color and a transition property. If the AI returns a rewritten stylesheet instead, reject it and ask again for the smallest change. Preview the result on staging and check hover on both desktop and touch devices.
This category works because the change is easy to preview, limited to the stylesheet, and easy to undo. If the CSS is wrong, you delete it and the site returns to its earlier state. One common mistake is styling a section that Elementor controls. Check Elementor’s own style settings first, because theme CSS may not apply there.
Child theme edits
AI can draft the starting files for a child theme: style.css with the required header, functions.php, and the code that loads the parent stylesheet. It can also show you how to override a single template part by copying that file into the child theme and editing the copy. A simple hook or filter in functions.php, such as changing an excerpt length, is another reasonable request.
Check three things before you activate anything: the file paths, the parent theme name in the header, and the enqueue code. Child themes most often fail because of a wrong path or a typo in the parent reference. Compare the output against the WordPress child theme handbook, which is free and short.
Copy and microcopy
AI writes usable first drafts of button text, placeholder text, and empty-state messages such as “No results found.” It can also produce demo content for theme setup, which saves time when you are building a preview site. A realistic limit applies: the output tends toward generic phrasing.
If every button on your site reads like it came from the same template, visitors notice the sameness. Treat the output as a draft and rewrite it in your own voice. Give the AI two or three of your own sentences as a tone sample, and the drafts usually land closer.
Explaining code
Paste a template file and ask “What does this file do?” before you edit it. This turns an unfamiliar single.php or header.php into a short plain-English summary. It saves the most time when you are about to change a file you did not write.
An explanation is only useful if it is accurate. Read it against the file, and ask the AI to point to the specific lines behind each claim. If it describes a function you cannot find in the file, treat the whole explanation as suspect.
Where AI breaks things
Each failure below follows the same pattern: what you ask, what the AI may produce, what breaks, and how to catch it. These are the patterns to look for, not a record of one particular run.
Invented hooks, functions, and theme options
Ask for “the hook that changes the footer text in this theme,” and the AI may name a hook that does not exist in your theme. The code then does nothing, or throws a fatal error if it calls a missing function. Catch it by searching your theme files for the exact name. If the search finds nothing, the AI made it up.
CSS that works in the screenshot but fails elsewhere
A screenshot shows one screen width in one colour mode. CSS written from it can break the mobile layout or look wrong in dark mode, if your theme offers one. Catch it by testing at desktop, tablet, and phone widths on staging, and by switching modes.
Editing the parent theme instead of the child theme
Unless you say otherwise, an assistant may tell you to edit a file in the parent theme. The change works today and disappears at the next theme update. Catch it by checking which folder every file path points to before you save anything.
Missing escaping and sanitisation in PHP
Escaping and sanitisation are the checks that stop user input from becoming an attack. AI-written PHP that prints a value or saves a form field may skip them. This is the security failure, and it can look fine on screen. Catch it by asking the AI directly whether each output is escaped and each input sanitised, and by having someone who reads PHP review the code.
Block theme confusion
In a block theme, one change can belong in theme.json, in custom CSS, or in a template file. The AI may pick the wrong one, and the edit then has no visible effect or conflicts with another setting. If you are on a block theme, name that in your prompt and ask which location fits and why.
Confident wrong answers and regressions
AI may cite a settings path that is not in your admin menu, such as “go to Appearance, then Theme Options, then Footer” when no such screen exists. It may also fix one problem and change something else in the same reply. Catch the first by checking the admin yourself, and the second by comparing the full file before and after, not only the lines you asked about.
Conflicts the AI cannot see
The AI sees the file you paste, not the plugins running on your site. An edit that works alone can clash with an active plugin. Mention your key plugins in the prompt, and test the page on staging with them active.
Scorecard
This table is my risk rating based on how each task behaves in practice. It is not measured data.
| Task | Typical result | Effort to fix | Risk level |
|---|---|---|---|
| CSS tweaks | Often works, sometimes needs a small correction | Low | Low |
| Child theme scaffold | Usually close, check paths | Low to medium | Low |
| Template override | Works if the right file is named | Medium | Medium |
| PHP hook or filter | Needs review for invented names | Medium | Medium to high |
| Copy and microcopy | Usable draft, generic tone | Low | Low |
| Block theme edits | Wrong location is common | Medium to high | Medium |
Verdicts:
- CSS: good fit, keep requests small.
- Child theme: good for boilerplate, verify every path.
- PHP logic: use for drafts only, and have the output reviewed.
- Copy: fine as a first draft, rewrite it in your voice.
- Block themes: be explicit about where the change belongs.
A practical workflow that holds up
Give the AI context. Paste the actual file, name the theme, and state your WordPress version. A prompt without those details forces the AI to guess, and guesses produce invented hooks.
Ask for the smallest possible change. A one-line CSS fix is easy to check, while a rewritten template file is not. Review the difference between your file and the new version before saving, and never paste code you have not read.
Test on staging at desktop, tablet, and mobile widths. Check dark mode too if your theme supports it. Only after that should the change reach the live site.
A rule of thumb: use AI for drafts and boilerplate, and use a human for anything touching security, data, or checkout.
When not to use AI for customisation
Skip AI for anything that handles user input, forms, payments, or logins. A mistake in these areas is a security problem, not a visual glitch. Skip it on live sites with no backup, because you have no way back if the edit fails.
Avoid AI for deep structural changes where you cannot read the code yourself. If you cannot judge the output, you cannot catch its errors. Finally, check the theme documentation first. A theme option or documented setting may already do what you need, with no code at all.
Closing
AI is a fast junior assistant, not a theme developer. It drafts quickly and needs review on everything it produces. Treat its output the way you would treat work from someone in their first week.
The same habits apply to any theme, so run a small test before you hand over anything important. If you want to check a setting before reaching for AI, start with your theme’s documentation.
Last modified:




