Get a free website with any plan

See how
WORDPRESS

Child themes: why your edits keep disappearing

IN SHORT

A child theme is a small companion theme in WordPress that holds only your customizations and loads on top of a parent theme. Editing a parent theme's files directly fails because WordPress overwrites the entire theme folder on every update. A child theme's folder is never touched, so its changes survive updates.

If your CSS tweaks or template changes keep vanishing after a theme update, the cause is almost always the same: you edited the parent theme's files directly. WordPress updates replace every file in a theme's folder, including the ones you touched. The fix is a child theme, a small companion theme that holds only your changes and loads on top of the parent. Update the parent freely; your customizations survive because they live somewhere the updater never touches.

This is different from a plugin conflict or a broken update that needs a rollback. Nothing is broken here. The theme did exactly what an update is supposed to do: it replaced its own files with new ones. Your mistake was putting custom code in the file path that gets replaced.

Why direct edits don't survive

A theme's files live in wp-content/themes/theme-name/. When you install an update, WordPress downloads the new version of that theme and overwrites the folder. It has no way to tell "this is the developer's original code" from "this is a line you added on a Tuesday afternoon." Everything in the folder gets replaced, full stop.

The same applies to CSS added through style.css, a modified functions.php, or an edited template file like single.php. All of it lives inside the parent theme's folder, so all of it is at risk on the next update. If you never update the theme, your edits are safe, but that means never getting bug fixes or security patches either. That's a bad trade.

How a child theme fixes it

A child theme is a separate folder that inherits everything from a parent theme (styles, templates, functionality) and lets you override only the pieces you want to change. WordPress loads the parent theme's functions.php and the child theme's functions.php together, and it loads the child's style.css after the parent's, so your rules win on any conflicting selector.

To create one:

  1. Make a new folder in wp-content/themes/, named something like theme-name-child.
  2. Add a style.css file with a header comment that includes Theme Name: and Template: (the Template value must match the parent theme's folder name exactly, case-sensitive).
  3. Add a line to enqueue the parent's stylesheet, and optionally the child's, via wp_enqueue_scripts in a child functions.php. Most current theme documentation gives you the exact snippet since it varies slightly by theme.
  4. Activate the child theme from Appearance → Themes in wp-admin, the same way you'd activate any theme.

Once it's active, put your CSS overrides in the child's style.css and any custom PHP in the child's functions.php. If you need to change a specific template, copy that one file from the parent into the matching path in the child folder and edit the copy. The parent theme updates normally from here on; your child theme folder is never touched.

Before you build one, it's worth testing on a copy of your site rather than live. See using WordPress staging for that workflow, particularly if the theme has heavy custom styling and you want to confirm nothing visually shifts.

If you already have a broken parent-theme edit

If an update already wiped changes you made directly to the parent theme, you'll need to redo that work in a child theme rather than recover it. There's no way to pull the old edits back out of an updated theme folder. Note what you changed (if you're not sure, compare against the current theme defaults), recreate it in the child theme, and it's permanent from that point on.

When a plugin beats a child theme

A child theme is the right tool for CSS tweaks, small template overrides, and theme-specific functions. It's the wrong tool for functionality that shouldn't disappear if you ever switch themes.

Use a plugin instead when:

  • The feature is independent of appearance. Custom post types, shortcodes, form handling, and API integrations belong in a plugin (a simple "site-specific plugin" with a few functions is enough) because they should keep working no matter what theme is active.
  • You might switch themes later. A child theme dies with its parent. If you switch from the parent theme to something else, every child theme customization goes with it. Plugin-based functionality survives a theme change.
  • You're using a page builder. Elementor, Divi, and similar tools manage their own styling layer and mostly sidestep this problem already, since design changes are stored in the builder's own data, not theme template files.

A reasonable rule: if it's visual and tied to how this specific theme renders things, child theme. If it's a feature you'd want to keep regardless of theme, plugin or must-use plugin.

When to contact support

If a child theme isn't inheriting styles correctly, or the Template header doesn't seem to match despite looking right, open a ticket from Support → New ticket in the portal. It's a fast thing for a real person to check against your actual file structure, and worth doing before you assume the theme itself is broken.

Common questions

Why did my CSS changes disappear after updating my theme?

You edited the parent theme's files directly, and the update overwrote the whole theme folder, including your changes. Nothing broke: the update did exactly what it's supposed to do. Move your CSS into a child theme's style.css so it lives outside the folder that gets replaced.

Can I get my old edits back?

No. Once an update overwrites the parent theme folder, there's no way to pull the old edits back out. Note what you changed, if you're not sure, compare against the current theme defaults, then recreate it in a child theme so it's permanent from that point on.

Do I need a child theme or a plugin for my custom code?

If the change is visual and tied to how this specific theme renders things, use a child theme. If it's a feature you'd want to keep no matter what theme is active, custom post types, shortcodes, form handling, API integrations, use a plugin instead, since a child theme dies the moment you switch parent themes.

What goes in the child theme's style.css header?

It needs a header comment with Theme Name and Template, where Template must match the parent theme's folder name exactly, case-sensitive. Get that wrong and WordPress won't recognize the child theme as inheriting from the right parent.

My child theme isn't inheriting the parent's styles, what do I do?

Double check the Template header value against the parent theme's actual folder name first, since a mismatch there is the most common cause. If it still looks right and styles aren't inheriting, open a ticket from Support, New ticket in the portal so someone can check it against your actual file structure.

CAN'T FIND IT?

Real humans answer fast.

Hosting with us? Open a ticket and a real person replies - no scripts, no upsells. Still choosing a host? The same team is included with every plan, from day one.