WordPress Child Themes Explained: What They Are and How to Create One
What a WordPress child theme is, why customisations belong in one, how to create a child theme (style.css header, functions.php, template overrides), and when you don't need one.

On this page
- A child theme keeps customisations safe from parent theme updates.
- Create a folder with style.css (naming the parent in Template) and functions.php.
- Put functionality in a plugin instead, and test the switch to a child theme on staging.
If anyone has ever edited your theme's files directly, the next theme update will wipe those changes out. A child theme solves this: it holds your customisations separately, so the parent theme can be updated safely.
What a child theme is
A child theme is a small theme that inherits everything from a parent theme and only overrides what you change. WordPress loads the child theme's files first, falling back to the parent for everything else.
When you need one
- Adding custom PHP functions to the theme
- Overriding theme template files
- Adding significant custom CSS
When you don't
- Small CSS tweaks can go in the Customizer's Additional CSS or your page builder's custom CSS
- Site-wide functionality (not design) is better in a small custom plugin; see plugin vs custom code
- Sites built entirely in a page builder with no code changes
How to create one
- Create a new folder in wp-content/themes, for example
astra-child - Add a
style.cssfile with a header naming the parent theme's folder in the Template line:/* Theme Name: Astra Child Template: astra */ - Add a
functions.phpfile. For many classic themes, use it to load the parent theme's stylesheet with WordPress's enqueue functions (check your parent theme's documentation, as some load it automatically) - Activate the child theme in Appearance → Themes
Many popular themes also offer a ready-made child theme or a generator tool.
Overriding templates
To change a template, copy the file from the parent theme into the same path in the child theme and edit the copy. After parent updates, check whether the original template changed significantly.
Block themes
Block themes can have child themes too, with their own theme.json for style changes and HTML templates; see block themes explained.
Switching an existing site to a child theme
Activating a child theme can reset some theme customiser settings and menu locations. Test on staging, note your settings first and move any direct edits from the parent into the child; see updating premium themes safely.
Need help with your website?
I'm Sameer, a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote within 24 hours.


