Technote

Themes & plugins Intro

Series Making a theme feel like your brand Part 1 of 8

Edit the parent theme and the next update erases it

A theme update replaces the whole folder — that is correct behaviour. Which is why your changes need to live somewhere it does not reach.

The spacing in your purchased theme is wrong, so you open the theme folder, edit the CSS, and the screen changes. Problem solved — until a few weeks later, when you press the update button and every one of those edits disappears. It is the most deflating first experience a designer has with WordPress.

This is not a flaw. It is evidence that things are working correctly. Once you accept that, the job narrows to one thing: put your changes somewhere the update does not reach.

What an update actually does

A theme update does not compare files line by line and merge in the changes. It deletes the existing theme folder and puts the new version in its place. That is how the author’s security fixes and bug fixes arrive complete. If an update politely stepped around your edits, some files would stay on the old version — and if the vulnerability was in one of those, it would stay too.

Which makes editing parent theme files through the admin theme editor risky twice over. The edits vanish on update, and the editor itself is the fastest route to planting code on a server once an administrator account is compromised. Turning it off on a live site is not an inconvenience; it is ordinary configuration.

Same edit — where you put it decides what a year from now looks like

What a child theme does

A child theme is just another theme folder that declares “this theme is my parent”. When WordPress draws a page it looks in the child first and falls back to the parent for anything missing. Styles and templates both follow that rule.

The important part is that a child theme does not replace the parent. The parent stays installed and keeps receiving updates. The child is a thin layer on top, and that thin layer is the only thing you own.

Keeping it thin is the whole discipline. Every file you put in the child is a file you have agreed to maintain, so only add one when the reason is clear. That principle returns in part four, on template overrides.

So where does each change belong?

There are really three places a design change can live, and you should work down the list rather than up it.

Three places a change can live — work down from the top

If the theme already offers a setting for a colour or a logo, use it. Only the design decisions no setting can express need to drop down into child theme CSS. And anything that must survive a change of theme — enquiry forms, structured content — belongs in a plugin rather than a theme. Those are precisely the things that must not disappear when the design does.

How theme choice affects long-term maintenance is covered further in the Themes & plugins archive, and if you have a site with edits already baked into a parent theme, untangling that is part of our optimization program.

Next part

Next we actually build the child theme. It takes two files — and if you get the stylesheet load order wrong in one of them, none of your CSS will apply no matter how much you write.

More on this topic

All technotes

Themes & plugins Practical

Decide the editable regions before you design them

A design the CMS cannot express stays up for negotiation long after it ships. Deciding what editors may change, first, removes the negotiation entirely.

Designers 6 min read

₩270,000 · Join the program