Updating a theme can wipe out hours of work in a matter of seconds. This happens when changes have been made directly to the parent theme.
A WordPress child theme It avoids this problem. It allows you to preserve your theme customisations and the work you’ve already done.
It is not a solution that should be implemented in all circumstances. It should be chosen only when it is genuinely needed, and then managed systematically.
Key points
- A WordPress child theme protects custom CSS, PHP functions and templates from updates to the parent theme, which must remain installed.
- It should be used for structural and design changes intended to be long-lasting; general functionality, analytics and conversions should be managed using a plugin.
- For classic themes, you need at least the child folder and a
style.csswith the pitchTemplate; the CSS must be loaded usingwp_enqueue_style(). - In block-based topics,
theme.json, templates and template parts allow for selective customisation without duplicating the entire parent theme. - Backups, staging and testing after every update are essential: the child site protects the files, but does not prevent incompatibilities with new CSS classes, functions or markup from the parent site.
WordPress child theme: what it is and how it works
A WordPress child theme is a separate folder that inherits the appearance and functionality of the parent theme. WordPress loads the parent theme, then applies the changes contained in the child theme and searches for the corresponding template files.
The parent theme must remain installed. If you delete it, the child theme will stop working. The official documentation defines the WordPress child theme as extensions of the main theme, designed to allow you to modify the site without altering the original files.
The child does not copy the entire theme
The point is not to duplicate the parent theme. The point is to edit only what you need, leaving the unmodified template files in the main theme.
You can add a stylesheet, a PHP function, a template file specifically for the services page, or a custom header. If the child theme contains a version of the same template file, WordPress will use that instead of the one from the parent theme.
This approach makes it easier to update the website. The fewer files you modify – including overwritten template files – the fewer elements you need to check after each update.
Because it protects your investment
A company website is not static. Its content, offers, plugins, forms, cookie banners, commercial pages and external integrations are constantly changing.
If your developer modifies the main theme directly, the next update may remove CSS, PHP customisations and custom templates. This could result in a broken layout, a missing CTA or a form that no longer submits requests.
A child theme protects your customisations, but it is no substitute for testing. Even a legitimate update to the parent theme may alter CSS classes, functions or markup.
When to use a child theme and when to avoid it
A WordPress child theme depends on the parent theme and is useful when the website requires changes that need to be permanent. It is a useful option for a redesign intended to survive updates to the parent theme, a WooCommerce e-commerce site or a project with a custom design.
Situations in which I would recommend it
Use a child theme if you need to:
- edit PHP files, hooks or theme functions, and customise page template files;
- add stable CSS for the header, footer and modules, or make changes to the article template file;
- customise the product template file for a WooCommerce e-commerce site;
- create or edit the archive template file;
- manage WooCommerce customisations by editing the relevant template file and carry out a gradual, well-organised redesign over time.
In my work with SMEs, child themes often feature in projects that require continuity. A website must remain updatable, secure and easy to maintain, without disrupting the continuity of the parent theme during updates. The best practice for WordPress websites It all starts here too: well-organised changes, fewer ad-hoc measures and regular checks.
When is it best not to use it?
Not every change requires a child theme. If you need to add Analytics code, a Google Ads conversion or a feature unrelated to the design, it’s better to use a dedicated plugin or a custom plugin.
Even just a couple of lines of CSS might not warrant a child theme, if the theme offers an additional CSS field and the changes are really minor. Be careful, though: as the number of changes increases, that field will soon become a cluttered mess.
The rule is simple: choose a WordPress child theme for the design, template and theme customisations; put the general functionality into a plugin instead.
Creating a classic child theme without errors
Before making any changes to the live site, carry out a full backup and work in a staging environment. An error in the PHP code can cause a white screen and crash the front end.
The minimum files to prepare
Using an FTP client or a file manager, open the folder wp-content/themes/. Create a new directory here, for example child-theme-name.
The file style.css It is essential. The header must include at least the name of the child and the field Template. The value of Template It must match the technical name of the parent theme’s folder, not the commercial name displayed in the interface. This distinction helps to avoid errors during theme updates.
Please also prepare the file functions.php when you need to load CSS or add functions.
Once you have created the files, you can install and activate the child from Appearance > Themes. The parent theme must remain installed. Keep the parent theme up to date by checking for updates to the theme on the staging environment.
For a classic theme, the source files are therefore:
- the child theme folder;
style.csswith the correct header;- the file
functions.php, when you need to load CSS or add functions.
If you need to modify the HTML structure, simply overwrite the relevant template file in the child theme. WordPress will use that template file and look for the corresponding one in the parent theme if the former does not exist. Do not duplicate every template file: just create the template file that you actually want to customise.
Load the CSS using wp_enqueue_style
Avoid the old rule @import in the style sheet. This can slow down loading and make it more difficult to manage dependencies, order and caching.
In the child’s PHP file, WordPress must first load the parent’s stylesheet and then the child’s stylesheet. The loading order must be managed via the action wp_enqueue_scripts.
The correct function is wp_enqueue_style(), used to save and upload CSS sheets. The Official documentation for wp_enqueue_style explains the method used by WordPress. This is not a technical detail to be overlooked. If CSS is loaded in the wrong order, your changes may disappear.
If a CSS rule isn’t being applied, don’t jump straight to using the `important` property. First, check the selector’s specificity, the loading order and the cache.
Theme by blocks and rows theme.json: what’s changing
Modern block-based themes work differently from classic themes. In the former, the file theme.json It handles most of the overall styling, whilst the style sheet remains useful for targeted CSS adjustments.
Colours, fonts, spacing, block styles and overall layouts can be defined in the file theme.json. This is why a modern WordPress child theme is often more configuration-based and less reliant on a traditional stylesheet.
Customise the file theme.json selectively
You can insert your own file into the child theme.json to change only the necessary values. You can define, for example, a corporate colour palette, the typography for headings or the radius of buttons.
The file settings theme.json In the child theme, these take precedence over those in the parent theme. The parent theme provides the foundation, whilst the child theme extends the parent theme only where necessary.
However, there is another level: changes saved by the user in the WordPress dashboard may override the settings in the file theme.json.
If the frontend does not display the expected result, don’t immediately blame the file theme.json. It also checks the global styles saved by the user.
For block-based themes, WordPress manages assets and styles using different approaches to those used in classic themes. The guide on how to include assets in WordPress themes It is useful when you need to add CSS sheets, scripts or custom resources.
Templates and template parts
In block-based themes, each template file defines the structure of a page. To override specific elements, select the required template file and leave the others unchanged. The template file to be copied is usually located in the folder templates/; the other page template files remain unchanged.
Do you just want to change the header? Copy the header template file and edit that one, not the whole theme. For the footer, copy the relevant template file only if necessary. For a different services page, copy the page’s template file into the child theme, keeping the same name and path.
The same rule applies to both classic themes and block themes: do not copy the entire parent theme without a specific reason. If a template file is missing from the child theme, WordPress will use the parent theme’s version in accordance with the template hierarchy. Every duplicated template file becomes a file that needs to be checked during future updates.
Updates, performance and common issues
A WordPress child theme should be managed just like any other important part of the website. Backups, staging, testing and monitoring must be part of the checklist. It is not enough simply to check that the homepage loads.
Test before and after each update
Before updating the theme, make a note of the most important pages and template files to check: the homepage, services pages, contact forms, checkout, members’ area and mobile version. Update them first in a staging environment, then check the layout, forms, CTAs, menus and conversion pages in production.
Compare the updated parent theme with the child theme’s customisations, particularly in the template files that depend on the parent. After the update, double-check the modified template files.
Also check the performance metrics. In Google Search Console, take a look at the Core Web Vitals: LCP below 2.5 seconds, INP below 200 ms and CLS below 0.1 are useful benchmarks.
Even a minor change to a stylesheet or JavaScript can slow down loading times on smartphones. For SMEs, a professional WordPress management It also means preventing these problems before they affect leads and sales.
Troubleshooting the most common faults
If the child theme does not appear amongst the available themes, check the field Template in the file style.css: In most cases, the problem is that the parent folder has been named incorrectly. For activation errors, also check the file functions.php.
If the layout loses its styles, check that the stylesheet is loading via wp_enqueue_style(). Clear the browser cache, plugin caches and the CDN cache, then check the CSS code and the relevant template files. If a page goes blank, temporarily switch back to the default theme and check the error log.
If you are using a block-based theme, check the settings in the file theme.json. However, customisations made in the Site Editor may override the file theme.json, so make sure you distinguish between the values in the file and the styles saved in the Site Editor. Only enable debug mode on the staging environment; never do so on a live site where error messages are visible.
The child theme is not an SEO trick
A WordPress child theme does not, on its own, improve your search engine ranking. It does not bring in visitors, does not generate leads and does not automatically make your website faster.
However, it allows you to maintain changes over time that affect UX, mobile, accessibility, performance and conversions. It’s a solid technical foundation, not an SEO shortcut.
If your website requires structural changes, use a WordPress child theme in a well-thought-out way. Keep changes to a minimum, check the results and manage updates carefully.
Frequently asked questions about WordPress child themes
Is the child theme compulsory?
No. You need it when you edit files, CSS or templates. For minor changes, a plugin or the theme’s built-in options are sufficient.
Does a child theme improve SEO?
Not directly. However, it can incorporate changes that improve speed, structure, accessibility and mobile usability. These aspects contribute to the user experience.
Can I use Child Theme Configurator?
Yes. You can create a child theme, particularly with classic themes. Check the result on the staging environment before using it in production.
Do updates to the parent delete the child?
No. The parent theme retains the child theme’s files, but may alter the HTML, CSS classes or functions. Test the site after every update.
Can I delete the parent after activating the child?
No. The child theme depends on the parent theme. If you remove it, WordPress will no longer load the inherited files, functions and styles.