If you have ever updated a WordPress theme and watched your custom styles or template changes disappear, you have met the problem child themes solve. A child theme sits on top of a parent theme and holds your changes separately, so the parent can be updated safely. This guide explains how child themes work, how to create one and when you can skip it.
What a child theme is
A child theme is a small theme that inherits everything from a parent theme: its templates, styles and functions. You only add the files you want to change. WordPress loads the child theme’s version of a file when it exists and falls back to the parent otherwise, which keeps your customisations small and easy to find.
The key benefit is safe updates. Theme developers release updates for security fixes, new WordPress features and bug fixes. If you edited the parent theme directly, an update overwrites those edits. With a child theme, the parent updates normally and your changes stay in place. This is why I use one on every site where the theme’s code is customised.
How to create a child theme
A child theme needs a folder in wp-content/themes and two files. The style.css file starts with a comment header containing the theme name and a Template line that matches the parent theme’s folder name. The functions.php file loads the parent stylesheet and any styles of your own using wp_enqueue_style.
Many popular themes, such as Astra, GeneratePress, Kadence and Hello Elementor, offer a ready-made child theme download, which saves time and avoids mistakes. Once the folder is uploaded, activate the child theme under Appearance > Themes. Customizer settings are stored per theme, so you may need to export them from the parent and import them into the child.
- 1New folderIn wp-content/themes
- 2style.cssHeader with Template line
- 3functions.phpEnqueue parent styles
- 4ActivateRe-import Customizer settings
- 5Override filesCopy only what you change
What to put in a child theme
Use the child theme for custom CSS that is too large for the Customizer, modified template files such as a custom single post or archive layout, and small functions such as registering an extra menu or changing excerpt length. Copy only the template files you actually change, and add a comment noting why.
Business logic, such as custom post types, payment gateways or integrations, should not live in the theme at all. Put it in a small custom plugin so it keeps working if the design changes. I follow this rule on every WordPress build and it makes future redesigns much easier, as I explain in my redesign checklist.
When you do not need one
If you only change settings in the Customizer or theme options panel, those settings are stored in the database and survive updates, so no child theme is needed. The same applies to sites built entirely with a page builder or the block editor, where layouts are saved as content.
Block themes add another option. With the Site Editor, templates and styles you customise are saved in the database rather than overwriting theme files. For many small changes, that is enough. Child themes still help with block themes when you need custom code, patterns or a custom theme.json, but they are no longer required for every tweak.
Common mistakes
The most common mistake is editing the parent theme because it seems quicker, then losing the changes at the next update. Another is copying the entire parent theme into the child, which defeats the point because the copied templates no longer receive the parent’s fixes. Copy single files only.
Watch out when the parent theme updates a template you have overridden. Your child version will not receive the improvement, so review changelogs for templates you copied. Test theme updates on a staging site first, and keep the child theme in version control or at least in your backups.
Child themes with page builders
If your site is built with Elementor, the Hello Elementor theme has an official child theme, and Astra, GeneratePress and Kadence all provide one. Using it costs nothing and gives you a safe place for custom CSS, PHP snippets and template overrides, even if you never need them in the first year.
For small CSS changes, the Customizer’s Additional CSS panel or the builder’s custom CSS field is often enough. Once you have more than a few dozen lines, move them into the child theme’s stylesheet, where they can be organised, commented and kept under version control. That also keeps the database clean and makes your styles easier to debug.
Child themes and long-term maintenance
A tidy child theme is documentation. When another developer opens the site in two years, they can see exactly what was customised and why. That makes maintenance faster and cheaper, which matters for every business that depends on its website.
If your site has edits in the parent theme, they can be moved into a child theme without visible changes. I do this regularly when taking over sites for ongoing maintenance. If you are planning to change theme entirely, read how to change a WordPress theme safely first.
Key takeaways
- Never edit a parent theme directly; updates will overwrite your changes.
- A child theme needs only style.css and functions.php to start.
- Keep business logic in a custom plugin, not the theme.
- Copy single template files only, and review them when the parent updates.
Frequently asked questions
Does a child theme slow down my site?
No. The overhead is negligible. A child theme loads one small extra stylesheet at most.
Can I add a child theme to an existing site?
Yes. Create and activate the child theme, then move any custom code from the parent into it and re-import Customizer settings.
Do block themes need child themes?
Not for most changes, since Site Editor edits are saved in the database. Use one when you need custom code or a modified theme.json.
What happens if I delete the parent theme?
The child theme stops working, because it depends on the parent. Keep the parent installed and updated.
Can I switch to a child theme without losing my design?
Usually yes. Settings stored in the Customizer may need to be exported and imported, and menus and widgets reassigned. Test the switch on a staging site first.
