A theme update replaces every file in the theme, so changes typed into those files vanish. Custom changes belong in a child theme, the Additional CSS panel or a small plugin, never in the theme itself.

The update that undid two years of changes

The dashboard said a theme update was available. Someone clicked it, as the dashboard suggested, and within a minute the site looked different.

The phone number in the header was gone. The colours had reverted to the theme's defaults, the footer showed the demonstration text the theme shipped with, and the booking button had moved.

Less visibly, the analytics tracking code had gone too. Nobody noticed that for three weeks.

Nothing was hacked or broken. The update did exactly what updates do.

What a theme update actually does

A WordPress theme is a folder of files on the server. Updating it replaces that folder with the developer's new version.

Your pages, posts and menus live in the database, and your images in their own uploads folder, so they survive. So do most settings made in the Customizer.

Anything typed directly into the theme's files does not. The new version knows nothing about it, and replaces it without warning.

What usually gets lost

The first is the one that hurts longest. A missing phone number gets noticed the same day; missing tracking code just leaves the charts empty, and nobody opens Analytics often enough to see it.

What a child theme is

A child theme is a small theme that holds only your changes and borrows everything else from the original theme, known as the parent.

At its simplest it is a folder with a stylesheet naming the parent, plus any files you want to change. WordPress loads the parent, then applies the child's changes on top.

When the parent updates, the child is left alone. Your changes survive, and you still receive the developer's fixes.

Where each kind of change belongs

Small styling changes, such as a colour or a font size, can go in the Additional CSS panel in the Customizer. It is stored in the database, so theme updates leave it alone.

Changes to templates, such as a rearranged header or a different footer, belong in a child theme.

Code that adds a feature rather than changing the look, tracking code included, belongs in a small plugin. That way it survives even a change of theme.

Why changes end up in the wrong place

Usually because it was quickest. A developer under deadline, or an owner following a forum answer, opened the theme's files and typed.

WordPress makes this possible from the dashboard. Since version 4.9, its built-in code editor warns against exactly this before you edit a theme file, but the warning is easy to dismiss.

Some themes also encourage it, with instructions telling customers to paste code into a theme file and no mention of what happens at the next update.

A worked example

A yoga studio's site ran on a commercial theme, with the class timetable on the home page and the studio's colours throughout.

The original developer had made every change directly in the theme: colours in the stylesheet, the timetable layout in a template, and the analytics code in the header file.

Two years later, the studio manager applied a theme update the dashboard recommended. The colours, the timetable layout and the tracking code disappeared together.

A developer restored the site from the previous night's backup, then rebuilt the changes properly: a child theme for the templates and colours, and the tracking code in a small plugin.

Without that backup, the original changes would have had to be pieced together from memory and old screenshots.

The theme now updates like any other. Nobody has to remember which files must never be touched.

How to check whether your changes are safe

In the dashboard, look under Appearance, then Themes. If the active theme's details say it is a child theme of another, that is a good sign.

If it is not a child theme, ask whoever built the site whether any theme files were edited. An update that has sat pending for months is often a clue that somebody already knows the answer.

A developer can settle it precisely by comparing your theme's files with a fresh copy of the same version, which lists every line that differs.

Moving an existing site to a child theme

Setting up a child theme on a new site takes minutes. Moving an established site onto one is careful work rather than a large job.

The edits have to be found and moved, and some Customizer settings, such as menu positions, are stored against the theme's name and need setting again once the child is active.

It should be done on a copy of the site first, after a backup, and checked page by page before the switch. Then the parent theme can finally be updated.

A theme that never updates

Some sites have the opposite problem: a theme whose developer stopped releasing updates years ago, or whose licence lapsed so updates stopped arriving.

A child theme does not help there. The parent never receives security or compatibility fixes, and as WordPress and PHP move on, it falls further behind.

The answer is a supported replacement theme, or a rebuild, planned before something breaks rather than after.

The counter-case

Not every site needs a child theme.

A site where nobody has edited the theme's files, with every change made in the Customizer and the page content, can update its theme as it is.

A theme written for your business alone, with no outside developer releasing updates, is already yours to change, though its files should still be kept with a record of every change.

For a theme that receives updates from its developer, the rule stands: no changes in the theme's own files.

Before the next update

  1. Take a backup before any theme update.
  2. Check whether the active theme is a child theme.
  3. Ask who edited the theme's files, and what.
  4. Move tracking code into a small plugin.
  5. Move template changes into a child theme.
  6. Test on a copy before switching.
  7. Update the parent once the changes are safe.

Step four is the one to do first. It is the change most often lost, the one nobody notices for weeks, and the easiest to move somewhere updates cannot reach.

Keeping updates flowing at all is covered in the WordPress update that stopped updates.


Frequently asked questions

Why did my changes vanish after a theme update?

Because they were typed into the theme's own files, and an update replaces those files with the developer's new version. Content in the database survives; file edits do not.

What is a child theme?

A small theme that holds only your changes and borrows everything else from the original, the parent. The parent can then update without touching your changes.

Where should tracking code go?

In a small plugin rather than the theme's header file. That way it survives theme updates, and even a change to a different theme.

Is the Additional CSS panel safe from updates?

Yes. It is stored in the database rather than in the theme's files, so theme updates leave it alone. It suits small styling changes.

How can I tell whether my theme was edited?

Ask whoever built the site. A developer can also compare your theme files with a fresh copy of the same version, which lists every difference.

Is moving to a child theme difficult?

It is careful work rather than a large job: find the edits, move them, reset some Customizer settings, and test on a copy before switching.

West Coast Media Solutions Inc. provides web design, web development, hosting, digital marketing, and business consulting to organisations across Canada, drawing on more than twenty-five years in the field.

Theme update pending for months?

Send us the site address. We will find out what an update would remove and move it somewhere safe first.

Start a Conversation