WordPress child theme: your fixes vanished after a theme update, so what now
A WordPress child theme is a separate, small theme that uses the look and features of the parent theme and holds only your changes. When the author releases an update, WordPress replaces the parent theme's files and leaves the child theme untouched. So every fix in theme files should go there, not into the original.
Author: The TellMyShop team. A guide for WordPress site and WooCommerce store owners: the cause, the manual fix and the same work in a chat conversation.
Last updated: · 6 min read
How it usually goes: there were fixes, there was no child theme
The story is almost always the same. Someone, maybe you, maybe a friend who knows computers, maybe an agency three years ago, added something to the theme files. They changed the footer text in footer.php, added the Google Analytics code in header.php, pasted a few lines into functions.php, adjusted colours in the theme's style.css. Everything worked.
Then a dot appeared next to Updates in the dashboard. You clicked Update, because WordPress itself advises keeping things updated. The site now looks as it did on the day the theme was installed: the old footer is back, so are the colours, and traffic suddenly drops in your stats.
Nobody made a mistake during the update. A theme update simply replaces its files with the author's new versions. It doesn't know which lines were yours, so it doesn't keep them.
Can you recover what disappeared?
Only from a copy of the files made before the update. Check in order:
- Your host's backups. Most hosts keep file backups from the last few days. Restore only the theme folder from them, not the whole site, and certainly not the store database, or you'll lose newer orders.
- A backup plugin. If you have one, open the latest backup from before the update and extract the theme files.
- The computer of whoever made the changes. Developers often keep the changed files on their machine.
- An old version of the site in an internet archive. It won't give you the PHP code, but it shows the text and look you need to rebuild.
Once you have the old files, don't upload them back into the parent theme. Compare them with the new ones and move only the changes into a child theme. Otherwise the next update will do the same thing.
What goes in the child theme and what goes elsewhere
Not every fix needs a child theme. WordPress saves many visual changes in the database, and theme updates leave those alone.
| Change | Where to keep it | Survives a theme update |
|---|---|---|
| Button colour, spacing, font | Additional CSS or the global styles of a block theme | yes |
| Footer, header in a block theme | template in the site editor | yes, until you change theme |
| Changed template file (footer.php, single.php) | a copy of the file in the child theme | yes |
| Custom code in functions.php | the child theme's functions.php or a small plugin | yes |
| Google verification code, stats script | an SEO plugin or a code insertion plugin | yes |
| Change in a plugin file | plugin settings; a child theme won't help | no, it disappears when the plugin updates |
The short rule: if the change touches a file in the theme folder, you need a child theme. For a colour alone, Additional CSS in WordPress is enough.
How to set up a child theme, step by step
A child theme is a folder in wp-content/themes with a style.css file whose header names the parent theme. Classic themes usually also have a functions.php file that loads the parent's styles. The files are described precisely in the WordPress theme handbook on child themes, and GoDaddy has a simpler guide with examples.
By hand it goes like this:
- Back up your files and database in the hosting control panel.
- In the file manager, create a folder next to the parent theme, for example theme-name-child.
- Add style.css with a header: the child theme name and a Template line with the parent folder name.
- In a classic theme, add functions.php that loads the parent's stylesheet.
- Activate the child theme in Appearance → Themes.
- Check the menu, logo, colours and widgets. Some Customizer settings are saved separately for each theme, so after switching they sometimes need setting again.
- Only now move your changes: copy the template file you're changing into the child theme and edit the copy.
Some theme authors provide a ready child theme to download. If there is one, use it. Hostinger gathers in one place the ways to add custom CSS, including through a child theme.
Block themes: what to remember
In block themes, such as the default Twenty Twenty-Four and newer, you make most changes in the site editor. WordPress saves changed templates and global styles in the database and assigns them to the theme they were created in. When you switch to a child theme, those changes may disappear from view, because they belong to the parent. Before switching, note what you changed in the editor, or ask whoever looks after the site to move those changes.
If you don't touch files in a block theme, you often don't need a child theme at all. The site editor is enough.
How the chat sets up a child theme with a preview
The TellMyShop plugin for WordPress and WooCommerce gives your chat (Claude or ChatGPT) a tool that creates a child theme of the active theme. It sets up the needed files, and on activation it copies the Customizer settings from the parent: menu locations, logo and colours. In a block theme, the preview warns you if there are changes in the site editor assigned to the parent.
You: After the theme update the old footer came back. Make sure it doesn't happen again.
Your chat: The active theme is the classic Astra theme, with no child theme. Preview:
I'll move the footer in a second step, with a separate file preview. Save? (yes / no)
You: Yes.
Your chat: Saved. The homepage and a post respond correctly, and the menu and logo are in place.
old version: Active theme: Astra
new version: Active theme: Astra Child (new astra-child folder, style.css and functions.php)
new version: Copied settings: header and footer menus, logo, colours
The names in this conversation are examples. Setting up a child theme and changing theme files work in TellMyShop Pro once you turn on the Theme switch in the plugin panel. The switch lasts 24 hours and needs a database backup from today, which the plugin makes itself before the first change of the day. Before each file is saved, a copy of it is made, and PHP files are checked for syntax errors. You can undo the child theme setup from the change history: the plugin switches the theme back and removes the files it created. More on undoing in the guide on how to undo changes in WordPress.
What the chat won't do: recover fixes that have no copy anywhere, or restore your host's backups. The wp-config.php file is always blocked.
In TellMyShop Free the chat shows the list of themes and plugins with versions and available updates, so before you click Update you can see which theme is active and what's waiting to be updated. Free doesn't read theme files. If the site stopped working entirely after an update, start with WordPress broken after an update. You can download the free version from the TellMyShop Free page, and Pro is described on the TellMyShop for WordPress and WooCommerce page. Prices are on the pricing page.
Questions and answers
Can I recover the fixes a theme update wiped out?
Only from a copy of the files made before the update. Look for one in your host's backups, in a backup plugin or with whoever made the changes. If there's no copy, the fixes have to be rebuilt from screenshots or an old version of the site.
Will a child theme slow down my site?
Usually you won't notice any difference. A child theme is a small folder with a few files, and WordPress takes the rest from the parent theme. After activating it, check the homepage, a post and, in a store, the basket.
Will the menu and logo disappear when I activate a child theme?
They may, because WordPress saves some Customizer settings separately for each theme. When you set up a child theme by hand, menu locations, the logo and colours sometimes need setting again. When it activates a child theme, the TellMyShop plugin copies these settings from the parent theme.
Do I need a child theme for a small colour change?
No. Small visual changes are best entered in Additional CSS or in the global styles of a block theme. A child theme is needed when you change theme files, for example the footer template or functions.php.
Does a child theme protect against plugin updates?
No. A child theme only protects changes in theme files. Changes added to a plugin's files disappear when it updates, so such fixes are made through the plugin's settings, or in the child theme if the plugin allows it.
WordPress is a trademark of the WordPress Foundation. WooCommerce is a trademark of Automattic Inc. Claude is a trademark of Anthropic PBC. ChatGPT and OpenAI are trademarks of OpenAI. TellMyShop is not affiliated with these companies.