How to create a WordPress child theme (and why you must)
A child theme keeps your edits safe when the parent updates. Here's what it is, the two files it needs, and how to build, activate, and verify one.

Editorial opinion based on hands-on experience — not financial, investment, or professional advice. Some links may be affiliate links; see our disclosure.
- A child theme exists for one reason: so your edits survive when the parent theme is updated. Edit the parent directly and the next update wipes your work.
- It's two files — a
style.csswith a header that names the parent, and afunctions.phpthat loads the parent's styles. That's the whole skeleton. - You don't always need one. Block themes and the Customizer's Additional CSS box cover a lot of small tweaks without any child theme at all.
- The two mistakes that break child themes both come down to one field and one function: the wrong
Template:name and a missing style enqueue.
01What a child theme is, and why it matters
| Check | Good sign | Fix before moving on |
|---|---|---|
| Backup | You can roll back the site or setting | No restore point exists |
| Staging | Change is tested on a copy first | Live site is the first test |
| Mobile | The result works on a narrow viewport | Layout only works on desktop |
| Performance | No large new asset or plugin is added casually | The change slows every page |
A child theme is a small, separate theme that inherits everything from another theme — the parent. It uses the parent's templates, styles, and functions by default, and only overrides the specific pieces you change. Your customizations live in the child, completely outside the parent's files.
Why does that matter? Because themes get updated. When the author ships a new version to fix a bug or patch a security hole, the parent theme's files are replaced wholesale. Any edit you made directly inside those files is overwritten and gone — no warning, no undo.
A child theme breaks that trap. The parent can update freely; your changes sit safely in the child and keep working. You get the parent author's ongoing security and feature updates and your own customizations, instead of being forced to choose between them.
The cost is almost nothing — two small files. The payoff is that you never again face the choice between staying on a vulnerable old version and losing a day of work to an update. That trade is why "make a child theme first" is the oldest advice in WordPress customization.
02When you actually need one — and when you don't
The child theme rule is real, but it's narrower than it used to be. Modern WordPress gives you several ways to customize that survive updates without any child theme at all. Reach for a child theme only when those lighter options can't do the job.
You probably don't need a child theme if…
- You're making small CSS tweaks. Color changes, spacing, a font size — drop these in Appearance → Customize → Additional CSS. That box is stored in the database, not the theme files, so updates don't touch it.
- You're using a block theme. Block themes (the modern default) let you edit templates and styles in the Site Editor, and those changes save to the database as user customizations — separate from the theme's own files. Editing in the Site Editor is itself update-safe.
- You only change settings the theme exposes. Logo, menus, layout options, colors set through the Customizer or theme options panel all persist independently of theme updates.
You do need a child theme if…
- You're overriding template files (PHP). Changing how a page, header, or post is structured means copying a template into the child and editing it there.
- You're adding or changing functions. Custom
functions.phpcode — registering a feature, tweaking a hook, dequeuing a script — belongs in a child so an update can't erase it. - You have a lot of custom CSS. Beyond a handful of rules, a child theme's
style.cssis easier to manage and version than a giant Additional CSS box.
Rule of thumb: a few CSS lines or a block theme means no child theme needed. Template overrides or PHP means you want one. When in doubt, the child theme is the conservative, can't-hurt choice.
03The two files a child theme needs
A working child theme is genuinely just two files in a new folder inside wp-content/themes/. Call the folder something clear, like yourtheme-child. Inside it, you need a style.css and a functions.php. That's the entire minimum.
1. style.css — the header that names the parent
WordPress recognizes a theme by a special comment block at the top of style.css. For a child theme, the one field that does the real work is Template: — it must exactly match the parent theme's folder name. That single line is what tells WordPress "inherit everything from this parent."
A minimal header looks like this — the Template value here assumes the parent's folder is named twentytwentyfour:
Theme Name: Your Theme ChildTemplate: twentytwentyfourVersion: 1.0.0
Each line lives inside a /* ... */ CSS comment at the very top of the file. Theme Name is what shows up in your themes list; Template is the load-bearing one. Below that comment, you can add your own CSS rules — or none at all to start.
2. functions.php — load the parent's styles
On its own, a child theme's style.css does not automatically pull in the parent's stylesheet, so the site can render unstyled. The job of functions.php is to enqueue — properly load — the parent's styles so the child starts out looking exactly like the parent.
Conceptually, you hook into wp_enqueue_scripts and call wp_enqueue_style() to load the parent's stylesheet, then your own. A common minimal version:
add_action( 'wp_enqueue_scripts', 'child_enqueue_styles' );function child_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); }
The key detail: get_template_directory_uri() points at the parent's folder, while get_stylesheet_directory_uri() points at the child's. Mixing those two up is a classic source of "why won't my styles load" confusion. Many parent themes also document their own exact enqueue handle — worth checking their docs if styles don't behave.
04Creating it manually vs. with a plugin
You have two honest routes to a child theme: build the two files by hand, or let a plugin generate them. Neither is wrong — it comes down to whether you're comfortable touching files.
By hand
Create a new folder in wp-content/themes/ via SFTP or your host's file manager, add the style.css and functions.php described above, and you're done. This is the cleanest method — no extra plugin, full control, and you understand exactly what's in your theme. It's also a good way to actually learn how the pieces fit.
With a plugin
Child-theme generator plugins (Child Theme Configurator is the long-standing one) create the folder, write a correct header, and set up the style enqueue for you — picking the right parent from a dropdown. This is the safer path if you'd rather not edit files directly or you're unsure about the enqueue code.
One caveat with the plugin route: once the child theme exists and is activated, you can usually deactivate and delete the generator plugin. It's a one-time scaffolding tool, not something that needs to keep running. Leaving unused plugins active is just extra surface area.
And a reminder that saves real grief: many premium themes already ship a ready-made child theme inside their download bundle. If yours did, just install and activate that — there's nothing to build.
05Activating and verifying it
Once the two files exist in their folder, the child theme shows up under Appearance → Themes like any other theme. Activate it the same way — but do this on a staging copy first if the site is live, because activating swaps the active theme on the front end immediately.
Right after activating, sanity-check three things. They take a minute and catch the mistakes that otherwise hide until later:
- The site still looks right. If it suddenly renders as plain unstyled HTML, your parent styles aren't loading — almost always a
functions.phpenqueue problem. Fix that before anything else. - The themes screen shows the parent link. A correctly configured child theme displays a small note tying it to its parent. If WordPress complains the parent is missing, your
Template:value doesn't match the parent's folder name. - Your test edit appears. Add an obvious throwaway CSS rule to the child's
style.css(say, a loud background color), reload, and confirm it shows. Then remove it. Now you know edits in the child actually take effect.
Pass those three and you have a working child theme. From here, every customization goes in the child and survives parent updates — which was the whole point.
06What to put in your child theme
A child theme is the safe home for three kinds of customization. Knowing which goes where keeps it tidy and easy to maintain.
- Custom CSS. Add your style rules below the header comment in the child's
style.css. Because the child loads after the parent, your rules override the parent's where they conflict — no!importantgymnastics needed most of the time. - Template overrides. To change a specific template —
header.php,single.php, a block template part — copy that file from the parent into the same path inside the child, then edit the copy. WordPress automatically uses the child's version instead of the parent's. Never edit the parent's original. - Functions. Custom PHP — registering menus, adding image sizes, tweaking hooks — goes in the child's
functions.php. Unlike templates, a child'sfunctions.phpruns in addition to the parent's, not instead of it, so you only add what you need.
Keep changes minimal and documented with short comments. A child theme with three tidy overrides is a pleasure to maintain; one with forty copied templates becomes its own update headache when the parent's structure shifts.
07Common mistakes (and how to avoid them)
Most child-theme problems are the same handful of errors. Once you've seen them, they're easy to spot.
Wrong Template name
The Template: line in style.css must match the parent's folder name exactly — case included. If the parent folder is astra, then Template: Astra or Template: astra-theme will fail, and WordPress will say the parent theme is missing. When in doubt, look at the actual folder name in wp-content/themes/ and copy it character for character.
Missing or broken style enqueue
Forget the functions.php enqueue, or point it at the wrong directory, and the site renders without the parent's CSS — a jarring wall of unstyled text. If activating the child strips all the styling, the enqueue is the first place to look. Confirm you're using get_template_directory_uri() for the parent's stylesheet.
Editing the parent anyway
The whole point of a child theme is undone if you slip back into editing parent files "just this once." That edit dies at the next update. If you have a child theme active, make every change in the child — full stop.
Copying too many templates
Each parent template you copy into the child becomes frozen at the version you copied. If the parent later updates that template — a bug fix, a markup change — your child keeps the old copy and misses it. Override only the templates you genuinely need to change, and revisit them when the parent has a major update.
08Frequently asked questions
Does a child theme slow down my site?
Not in any way you'd notice. The overhead is loading one extra small stylesheet and one extra functions.php. The performance of your site is driven by the parent theme, your plugins, images, and hosting — not by the existence of a child theme.
Do I update the child theme or the parent?
You update the parent — that's where the author ships fixes and features. The child theme rarely needs updating; you change it only when you want to adjust your own customizations. This split is exactly why the child exists.
Will I lose my customizations if I switch parent themes?
Yes — a child theme is tied to one specific parent via its Template: line. Switching to a completely different parent theme means your child's CSS and template overrides were written for the old parent's structure and won't carry over cleanly. Treat a parent change as a fresh customization pass.
Can I make a child theme of a child theme?
No. WordPress supports one level of inheritance — a child of a parent. You can't nest a grandchild. If you need another layer of separation, you're usually better off consolidating into a single, well-organized child theme.
Is this the same on block themes?
The mechanics are the same (a folder, a style.css header naming the parent), but block themes shift a lot of customization into the Site Editor, which is already update-safe. For block themes, you often won't need a child theme at all unless you're overriding template files or adding PHP.
09The short version
A child theme is two files — a style.css whose header names the parent, and a functions.php that enqueues the parent's styles. It exists so your edits survive parent updates. Build it by hand or with a generator plugin, activate it (on staging if you're live), and verify the styles load and your test edit appears.
Skip it for small CSS tweaks or block-theme work; use it the moment you override templates or add PHP. Watch the two failure points — the Template: name and the style enqueue — and a child theme is a five-minute job that pays off for the life of the site. This is a practical how-to, not financial or business advice — every setup differs, so test on a copy before trusting it in production.


