If you want to customize a WordPress theme, sooner or later you will come across the term Child Theme. A child theme is a standalone theme that is based on another theme – the so-called Parent-Theme – builds upon and takes over its functions and design.
The decisive advantage: Custom modifications can be made in the child theme without directly altering the original files of the parent theme. As a result, your changes are normally preserved when the parent theme is updated.
However, you don't need a child theme for every minor design change. For example, if the logo, colors, fonts, or layout can already be adjusted via the theme, the WordPress Customizer, or the Site Editor, a child theme is usually unnecessary for this.
In this guide, we explain how parent and child themes work together, when a child theme makes sense, and how you can create a simple WordPress child theme yourself.
Briefly explained: A child theme adopts the foundation of a parent theme and allows for custom modifications in separate files. This means you do not have to modify the parent theme directly, and your own customizations will not simply be overwritten by new original files when it is updated.
What is a WordPress child theme? #
A child theme is a WordPress theme that uses another installed theme as a basis.
The underlying theme is referred to as Parent-Theme referred to as. The child theme can adopt its design and functions while simultaneously adding its own customizations or overriding specific theme files.
Put simply:
- Parent Theme provides the actual theme basis
- Child Theme: contains your individual customizations
The child theme is therefore not a complete copy of the parent theme. It normally contains only the files and customizations that are additionally required.
Why shouldn't you edit a parent theme directly? #
Technically, you can modify files of an installed WordPress theme. However, for a theme that continues to receive updates, this is usually not a good practice.
During an update, files of the parent theme are replaced or updated by the new version from the theme developer.
For example, if you made direct changes to:
functions.phpheader.phpfooter.php- Template files
- Stylesheets
these adjustments can be lost with the next theme update.
Important: Not updating a theme just to keep your own modifications is not a sensible solution. Theme updates can include bug fixes, compatibility adjustments, and security-relevant changes.
When is a child theme useful? #
A child theme is particularly useful if you want to make changes at the theme level that are not possible through the normal settings of the theme or WordPress.
Typical use cases are:
- add custom PHP functions
- Customize template files of a classic theme
- manage more extensive custom CSS adjustments in a structured way
- modify certain theme outputs
- add custom theme functionality
- Permanently separate customizations from the parent theme
Whether a child theme is the right solution depends, however, was you want to change.
When do you not need a child theme? #
Not every WordPress customization justifies a child theme.
If your theme already allows the desired change through its settings, you should normally use this intended feature.
For the following tasks, for example, you do not automatically need a child theme:
- Change logo
- Replace header image
- Edit menu
- Manage widgets
- Set as homepage
- Change colors via theme settings
- Change fonts via theme settings
- Design pages with a page builder
With a classic theme, many of these settings can be made available via the WordPress Customizer. You can find more about this under Using the WordPress Customizer: Customize theme, colors, and layout.
Child theme or additional CSS? #
If you only want to add a few minor CSS rules, you don't necessarily need a child theme for that.
With classic themes, for example, the area Additional CSS in the WordPress Customizer for minor adjustments.
A child theme becomes more interesting when the customizations become more extensive than what should be managed via files, or when additional PHP or template customizations are required.
So the decision shouldn't be „A child theme is always better,“ but rather: Which tool fits the planned change?
Child theme or plugin? #
This distinction is also important.
A function that is required regardless of your website's appearance does not automatically belong in a child theme.
An example: You program your own function that processes business-critical data and should continue to work even after a later theme switch.
Then a custom plugin can technically be the better solution.
A child theme is particularly suitable for customizations that are actually related to the theme used and its presentation or theme functionality.
Rule of thumb: If a function is tied to the theme or its presentation, a child theme can be useful. If a function should remain independent of the active theme, it often belongs in a plugin instead.
What do you need for a child theme? #
For a simple child theme, you first need:
- an installed parent theme
- a dedicated folder for the child theme
- at least one correctly configured
style.css
Depending on the customizations, additional files may be added, for example:
functions.php- Template files
- custom CSS files
- JavaScript files
- additional theme resources
For the basic recognition of a classic child theme, the correct assignment to the parent theme is primarily decisive.
Where are WordPress themes located? #
Installed WordPress themes are usually located in the directory:
wp-content/themes/
In it, each theme has its own folder.
To put it simply, the structure could look like this:
wp-content/
└── themes/
├── parent-theme/
└── parent-theme-child/
The exact name of the parent theme folder will be important later because it is used to link the child theme to its parent theme.
Check the folder name of the parent theme beforehand #
Before you create your child theme, you must know the exact directory name of the parent theme.
Assuming the parent theme is located here:
wp-content/themes/beispieltheme/
Then the relevant folder name is:
sample theme
You will need this value later in style.css of the child theme.
Important: Do not just use the visible marketing name of the theme. The deciding factor for
Template- Enter the actual directory name of the parent theme.
Step 1: Create a folder for the child theme #
Create within:
wp-content/themes/
a new folder for your child theme.
For example, if your parent theme has the folder:
sample theme
used, you could name your child theme like this:
sample-theme-child
The directory structure will then look like this:
wp-content/
└── themes/
├── beispieltheme/
└── beispieltheme-child/
The addition child is not technically required, but makes it immediately understandable what it is.
Step 2: Create style.css #
Create the file in the new child theme folder:
style.css
At the beginning of this file, WordPress requires a theme header.
A minimal variant could look like this, for example:
/*
Theme Name: Example Theme Child
Template: exampletheme
*/
The most important entry for the relationship to the parent theme is:
Template: sample theme
The value must correspond exactly to the folder name of the parent theme.
Create the theme header in more detail #
You can in the comment block of the style.css provide further information.
For example:
/*
Theme Name: Example Theme Child
Description: Child theme for custom modifications
Author: Your Name
Template: exampletheme
Version: 1.0.0
*/
For the technical assignment to the parent theme, the line in particular remains Template crucial.
Most common error: incorrect template value #
When WordPress reports that the parent theme is missing or the child theme is not working correctly, the first thing you should do is Template-Check value.
Assuming your parent theme is listed in the WordPress admin area as:
My Fantastic Theme
displayed, but the actual folder is:
my-fantastic-theme
Then in the style.css stand
Template: my-fantastic-theme
and not the visible theme name.
Step 3: functions.php – do you even need it? #
For a child theme, a functions.php created. However, it is not required in every case.
If you want to add your own PHP functions or load specific resources selectively, you can use a file in the child theme called:
functions.php
create.
It is important to understand that the functions.php of a child theme the corresponding file of the parent theme not simply replaced.
WordPress loads the functions of both themes in the designated sequence.
Very important: Therefore, do not simply copy the complete
functions.phpthe parent theme into your child theme. This can cause duplicate function definitions and fatal PHP errors.
Must the stylesheet of the parent theme be loaded manually? #
Here you can find many general and sometimes outdated guides on the internet.
Whether and how stylesheets must be additionally integrated depends on how the respective parent theme loads its styles.
With some themes no additional action is necessary. With others, correct integration via WordPress functions may be required.
That is why you shouldn't blindly any wp_enqueue_style()- Copying code from a third-party guide.
Instead, check the documentation of the parent theme being used first. Many professional themes explicitly document how to set up a child theme for that theme.
Why old child theme tutorials can be problematic #
WordPress and modern themes have evolved over many years. Therefore, a tutorial that was correct for a specific theme ten years ago is not necessarily the best approach for your theme today.
Themes differ particularly when loading stylesheets.
Therefore, a good guide should not claim that the exact same additional PHP code is necessary for every WordPress theme.
Step 4: Activate Child Theme in WordPress #
As soon as WordPress correctly recognizes your child theme, it should appear in the admin area under the installed themes.
Activate child theme #
- Log in to your WordPress admin area.
- Open Design → Themes.
- Look for your newly created child theme.
- Check that WordPress does not display an error message regarding the parent theme.
- Activate the child theme.
- Then open the public website.
- Check important pages and features.
The parent theme must remain installed. However, you activate the child theme.
Do not delete the parent theme after activating the child theme #
The child theme depends on its parent theme.
Therefore, you must not delete the parent theme just because the child theme is now active.
The child theme usually contains only your additions and modifications. The remaining theme files and functions still come from the parent theme.
If the parent theme is removed, the child theme lacks its foundation.
Continue updating parent theme #
Even if the child theme is active, you should still consider available updates for the parent theme.
That is precisely one of the main reasons for using a child theme: the parent theme can be updated while your separately saved child theme files remain intact.
We explain how to securely update themes, plugins, and WordPress itself at Updating WordPress: Keeping Core, Plugins, and Themes Secure and Up to Date.
Add CSS in child theme #
Custom CSS rules can be in the style.css can be stored in the child theme, provided that the stylesheet structure of the theme used supports this accordingly.
For example, a simple CSS rule could look like this:
.site-title {
font-size: 32px;
}
With this, you would set the font size of an element with the CSS class site title influence.
Whether this class actually exists on your website depends on the theme, however.
Important: CSS examples from other websites do not work automatically on your installation. You must consider the actual HTML and CSS structure of your theme.
Customize template files with a child theme #
An important use case for classic child themes is the customization of specific template files.
If WordPress or the theme finds a corresponding file in the child theme, it can be used instead of the corresponding template file of the parent theme.
This allows you to modify certain outputs without editing the original parent theme file.
Which files can be overwritten and how the template hierarchy works depends on the respective file and theme architecture.
Do not copy the template file completely without necessity #
Just because you want to change a single minor detail, you shouldn't indiscriminately copy numerous files from the parent theme to the child theme.
Every copied template file can cause maintenance overhead in the long run.
If the manufacturer updates the corresponding parent template later, your child theme may still use your older overridden version.
As a result, improvements or compatibility changes made to the parent theme for this file cannot be applied automatically.
Child themes are more update-safe – but not maintenance-free #
The statement „Nothing can happen with a child theme during updates“ would be false.
Your own files will not simply be overwritten by a normal parent theme update. Nevertheless, the parent theme can still change technically.
For example, can:
- HTML structures are changed
- Hooks can be changed or removed
- template files are being further developed
- CSS classes are changed
- functions are changed
As a result, custom modifications may still need to be checked and, if necessary, adjusted after a major parent theme update.
What happens to overridden templates after an update? #
If you have copied a template file from the parent theme into your child theme and modified it, your child version will normally remain intact.
On the one hand, that is the desired effect.
On the other hand, it means that later changes to the same parent file will not be automatically applied to your customized copy.
Therefore, during important theme updates, you should check whether the original file has changed and whether your child version remains compatible.
Understanding functions.php correctly #
The functions.php is often treated like a dumping ground for random code snippets. That is not a good practice.
Faulty PHP code can cause your website or the WordPress admin area to no longer load correctly.
A missing character or an incorrectly used function name can already cause a PHP error.
Therefore, only insert code whose purpose and origin you can understand.
Do not blindly copy code from the internet into functions.php #
On the internet you can find thousands of WordPress code snippets. Some are good, some are outdated and some are meant for a completely different configuration.
Before using a snippet, you should at least check:
- which problem the code solves
- which WordPress version or theme structure it is intended for
- whether required functions are available
- whether it is related to your theme or your plugins
- whether the code comes from a trusted source
For live websites, you should also not make changes without a backup and a way to test them.
What to do if the website stops working after a functions.php change? #
If a fatal error occurs immediately after a PHP modification, the cause is often the code that was last inserted or changed.
If you can no longer access the WordPress admin area, you may need to fix the file in question via your hosting's file manager or via SFTP.
Specifically remove or correct the last change made.
Do not randomly edit more WordPress files in the hope that the error will go away.
Create child theme via cPanel #
If your hosting provides cPanel with a file manager, you can also create the required folders and files directly via the browser.
Open the WordPress directory in the file manager and navigate to:
wp-content/themes/
There you can create the child theme folder as well as the required files.
You should be especially careful with PHP files. Even a single syntax error can impair the website.
Create a child theme locally and install it as a ZIP #
Alternatively, you can prepare the child theme files on your computer and then install them as a ZIP archive.
For example, the structure of the archive could look like this:
beispieltheme-child/
├── style.css
└── functions.php
The functions.php only need it if it is required for your specific configuration or customization.
You can then upload the ZIP archive via the normal WordPress theme installation.
We explain how themes are generally installed under Install new theme in WordPress.
Check child theme before activation #
Before activating a self-created child theme on a production website, you should check a few points.
- Is the
Template-Is the value correct? - Is the parent theme installed?
- Does it contain the
style.cssa valid theme header? - Does it contain the
functions.phponly required and tested code? - Were no parent theme files copied unnecessarily?
- Is there a current backup?
It is better to test the child theme in a staging environment first #
For a productive corporate website or online store, you should, if possible, avoid trying out extensive theme customizations directly on the live website for the first time.
A test or staging environment allows you to control changes before visitors are affected by them.
Another option is to clone an existing WordPress installation for testing. We explain how this works with Softaculous at Clone WordPress with Softaculous.
Elementor Child Theme – Do I need it? #
When you design your website with Elementor, you do not automatically need a child theme.
Many visual adjustments are made directly in Elementor or its theme and template functions.
A child theme can still be useful if you need custom modifications at the PHP or theme level.
Just because Elementor is installed, the answer is neither fundamentally „child theme required“ nor fundamentally „child theme unnecessary.“.
The decisive factor is the nature of your adaptation.
Child Theme for a Block Theme #
Even modern block themes can be extended and customized. However, their architecture differs in part significantly from classic themes.
Block themes use, among other things, templates, template parts, global styles, and the file theme.json.
Many adjustments can be made directly via the WordPress site editor without requiring a child theme.
However, if you want to develop more in-depth changes to a block theme, a child theme can also make sense there.
What is theme.json? #
theme.json is a central configuration file of modern WordPress themes that can be used, among other things, to define settings and design specifications for the block editor and website design.
This may include, for example:
- Colors
- Typography
- Spacers
- Layout settings
- Block-specific requirements
Working with theme.json belongs already to the more advanced areas of WordPress theme development.
For normal customizations of a WordPress website, you do not necessarily have to edit this file yourself.
Deactivate child theme #
A child theme is deactivated like any other WordPress theme by activating a different theme.
If you reactivate the parent theme directly, the customizations of the child theme will no longer be executed or used.
However, the child theme files will remain installed unless you delete the theme.
Delete child theme #
You can generally remove an inactive child theme just like any other installed theme.
Before doing that, however, you should check whether it contains any custom modifications that you will need later.
If you delete the child theme, its files and therefore your individual changes saved within them will be removed.
Therefore, create a backup beforehand if necessary.
Can I create a child theme afterwards? #
Yes. A child theme can generally also be created after a website has already been built with the parent theme.
However, what matters is where previous adjustments were saved.
If you have already modified files of the parent theme directly, these changes will not be automatically transferred to a new child theme.
You must therefore first determine which files or code areas have been changed and carefully apply the required adjustments to the child theme.
Find existing changes in the parent theme #
This can be difficult if changes have been made over a long period of time without documentation.
One possibility is to compare the modified theme files with an unmodified version of the same theme version.
This is how differences can be made visible.
Do not simply update the parent theme beforehand if there are still unsaved individual changes there. These could be lost as a result.
Theme Editor in the WordPress Admin Area #
Depending on the WordPress configuration, under Design a theme file editor be available.
This allows theme files to be edited directly in the browser.
However, for production websites, this is a risky workflow, especially with PHP files.
An error can cause the website to stop working correctly. For serious code adjustments, a clean development workflow, backups, and a test environment are the better approach.
A child theme is not a backup #
A child theme protects your own files from being overwritten by a standard parent theme update. However, it is not a data backup.
If files are accidentally deleted, an error occurs during editing, or the entire WordPress installation is damaged, a child theme does not replace a backup.
Therefore, regardless of this, you should have a current backup before making extensive adjustments.
Document child theme #
When developing your own customizations, you should document what has been changed.
This is especially helpful when you have to investigate a problem months later or another person takes over the website.
A simple documentation can record:
- which files were modified
- why the change was necessary
- which features have been added
- which parent theme version the customization originally came from
- whether certain plugins are required
The more individual a child theme becomes, the more important understandable documentation is.
Typical errors in WordPress child themes #
- Edit the parent theme directly and think about updates only later
- wrong folder name at
Templateuse - Delete parent theme after activating the child theme
- complete
functions.phpcopy the parent theme - copying outdated enqueue code without checking
- unnecessarily copying many parent templates
- Blindly pasting PHP code from unknown sources
- assume that a child theme never needs maintenance
- test extensive changes directly on the live website
- do not create a backup before code adjustments
- Mix theme functionality and plugin functionality
Note: A child theme is not a copy of the parent theme. It is a separate customization layer built upon the parent theme. Therefore, only copy files or add code that you actually need.
When should you contact CURIAWEB support? #
If you encounter a technical problem as a CURIAWEB customer when setting up a child theme, you can contact our support.
The following information is helpful:
- the affected domain
- Name of the parent theme
- which child theme is being used
- what change was made
- an existing error message
- whether the problem occurred immediately after a specific code change
However, in the case of individual development work or extensive changes to the theme code, a distinction must be made between technical hosting support and actual WordPress development.
Summary #
A WordPress Child-Theme is based on a parent theme and allows you to manage your own theme customizations separately from the original files. This ensures that updates to the parent theme can be performed without your child theme files simply being overwritten.
For a simple child theme, you need your own theme folder and a correctly configured style.css, whose Template- entry points exactly to the parent theme's folder. A functions.php or you only add your own template files if they are actually needed.
However, a child theme is not required for every customization. For the logo, colors, menus, or other settings provided by the theme, you should first use the existing WordPress and theme functions. How these work in classical themes is explained under Use WordPress Customizer.
When making changes to the theme code, test them carefully, keep the parent theme updated, and create a data backup before major modifications. A child theme protects custom adjustments from being overwritten by standard parent theme updates, but it replaces neither maintenance nor backups.