How to Update a WordPress Theme Without Losing Your Customisations
If updating a theme wipes your changes, the changes were in the wrong place. Here is how to move them somewhere updates cannot reach.
Updated 29 August 2026
A theme update replaces the theme's files with the new version. Anything you edited inside those files goes with them. This is not a bug — it is how updates work — and the answer is to stop putting your work where it will be overwritten.
Create a child theme
A child theme is a folder with two files that inherits everything from the parent and lets you override selectively. Parent updates then leave your work alone.
Create wp-content/themes/yourtheme-child/style.css:
/*
Theme Name: Your Theme Child
Template: yourtheme
Version: 1.0.0
*/
The Template value must exactly match the parent's folder name — this is the single most common thing people get wrong, and it produces a "broken theme" error.
Then functions.php in the same folder:
<?php
add_action( 'wp_enqueue_scripts', function () {
wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'child-style', get_stylesheet_directory_uri() . '/style.css',
[ 'parent-style' ], wp_get_theme()->get( 'Version' ) );
} );
Activate the child theme under Appearance → Themes. The site should look identical — if it does not, the parent's stylesheet is not loading and the Template line is usually why.
Move your changes across
- CSS goes in the child's
style.css. - PHP functions go in the child's
functions.php. Note it adds to the parent rather than replacing it, so only include your own code. - Template files are overridden by copying the parent's file to the same path in the child and editing the copy. Copy
single.phptoyourtheme-child/single.php, not a renamed version.
Where not to put code
Two things belong outside the theme entirely, because they should survive changing theme as well as updating it:
- Shortcodes and custom post types. If these live in the theme, your content breaks the day you switch theme. Put them in a small site-specific plugin.
- Tracking scripts and analytics. Same reasoning — use a plugin or your tag manager.
A site-specific plugin is just a folder in wp-content/plugins/ with one PHP file and a header comment. It takes two minutes and saves a great deal later.
If a child theme is not practical
For a handful of CSS rules, Appearance → Customise → Additional CSS is fine and survives updates. For small PHP additions, a code-snippets plugin stores them in the database and survives both theme updates and theme switches. Neither replaces a child theme for template changes, but for light customisation they are entirely reasonable.
Updating safely once the child theme exists
- Back up first.
- Read the changelog. Major version jumps sometimes rename template files, which breaks child overrides.
- Update on staging if you have overridden templates.
- After updating, compare your overridden templates against the new parent versions — the parent may have added markup your copy is now missing.
That last step is the maintenance cost of overriding templates. Override as few as you can get away with.
Recovering work you already lost
If an update has already overwritten your edits, check for a backup taken before the update. Failing that, some hosts keep daily filesystem snapshots you can browse. If neither exists, the work is gone — set up the child theme now so it does not happen twice.
Common questions
Does a child theme slow the site down?
Not meaningfully. It loads one extra small stylesheet. The performance difference is far smaller than the cost of losing your customisations.
Do I need a child theme for a block theme?
Less often. Block themes store template and style changes in the database via the Site Editor, and those survive updates. A child theme is still useful for PHP or for template files you want under version control.
Can I create a child theme after already customising the parent?
Yes. Create the child, copy your edited files and CSS into it, activate it, then restore the parent to its original version by reinstalling it.