Why We Hate Child Themes

(And How to Get Rid of Them)

We’ve been developing WordPress websites for nearly 20 years and in that time we’ve inherited, maintained, repaired and rebuilt websites using just about every theme you can imagine.

And if there’s one thing we’ve learnt, it’s that we really don’t like child themes.

In fact, we’ve spent years surgically removing them from clients’ websites and, despite encountering some pretty complicated examples, we’ve yet to find one we couldn’t get rid of.

Why do we dislike them so much? Well, where do we start …

What is a child theme anyway?

A child theme inherits its design and functionality from a parent theme, while keeping your customisations in a separate theme. Sounds sensible, doesn’t it? The problem is that the two still need to work together as the parent changes.

Where our hatred began

Back in 2018, we launched Options for Twenty Seventeen, the first in our range of plugins that extended the functionality of WordPress’s default themes.

The plugin proved rather popular, eventually reaching over 20,000 active installations.

But we began noticing something frustrating. Some users were installing our plugin alongside child themes, then complaining when certain options didn’t work properly.

Now, our plugins were designed to extend the default parent themes. If somebody had already modified the theme’s templates, HTML, CSS or JavaScript through a child theme, how could we possibly guarantee that our options would work as intended?

Sometimes they did. Sometimes they didn’t.

And yet somehow it was our plugin that was expected to accommodate whatever changes somebody else had made to the theme!

But the compatibility problems with our plugins were only part of the story. As we began inheriting more websites built by other developers, we noticed a much bigger problem.

Child themes don’t protect against updates. They prevent them.

This is probably our biggest objection to child themes.

We’re repeatedly told that child themes are the correct way to customise a WordPress theme because they protect your changes when the parent theme is updated.

And technically, they do preserve those changes.

But preserving your modifications doesn’t guarantee they’ll remain compatible with the updated parent theme.

We’ve encountered numerous websites where the parent theme hasn’t been updated for years because the website owner is worried that doing so will break the child theme.

And we’ve seen exactly that happen too. A parent theme gets updated, something changes in its HTML, CSS, JavaScript or PHP, and suddenly the child theme doesn’t work properly anymore.

The solution? Somebody needs to investigate the changes and update the child theme accordingly.

Who’s going to do that? The original developer? The website owner? Another developer who’s never seen the code before?

Often the easiest option appears to be … simply don’t update the parent theme.

And that is a terrible idea.

We’ve had clients come to us with compromised WordPress websites because their outdated parent themes contained documented security vulnerabilities.

These weren’t hypothetical risks. The websites had actually been hacked.

All because the parent theme hadn’t been kept up to date.

Now, to be clear, a child theme doesn’t technically stop you updating its parent. But if updating requires somebody to check that all the customisations still work, and nobody is willing or able to do that, the result is often the same.

No updates.

A system designed to protect your customisations has effectively discouraged the very updates your website needs.

Brilliant.

Then there’s performance

When we remove child themes, we consistently notice improvements in page rendering speed. We’ve seen the difference in browser developer tools, although we don’t have figures from those projects to publish here.

Some child themes do almost nothing. We’ve encountered ones with a single function in functions.php, and others with an empty stylesheet that the browser still has to download. Why?!

We suspect pre-built child themes and child-theme generator plugins explain a lot of this. They create and enqueue a stylesheet ready for customisations, even when nobody ever adds any CSS. 🤦‍♂️

Our experience has been consistent: remove the unnecessary child theme, retain the required modifications and the website becomes faster. Sometimes the difference is quite noticeable.

So how do we get rid of them?

This is the bit we actually enjoy. Some child themes take minutes to remove, others need rather more surgery, but the process is essentially the same. We inspect the files, work out what the child theme changes and move those changes somewhere that doesn’t require a child theme.

We prefer to do this on a development server. Where that hasn’t been possible, we’ve made the changes bit by bit on the live website, checking them as we go. Either way, take a full backup first and make sure you can restore it.

  1. Move the child theme’s CSS into Customizer > Additional CSS.
  2. Move custom PHP and JavaScript into a small plugin.
  3. Replace or relocate template overrides where necessary.
  4. Transfer the Customizer settings, switch to the parent theme and check everything before deleting the child theme.

That’s the outline. If you’d like to see how we handle each part, expand the explanations below.

Done. No more child theme.

But isn’t a child theme supposed to be best practice?

That’s what we’ve been told for years.

And WordPress still officially supports and documents child themes, so we’re certainly not suggesting they’re broken or that developers shouldn’t be allowed to use them.

But we’d question whether the traditional advice is still appropriate for most websites.

If you need to change some CSS, WordPress already provides Additional CSS.

If you need to add functionality, why not create a plugin?

If you need to modify the appearance or templates of a modern block theme, the Site Editor can already do an enormous amount without writing any code at all.

And if you need something more ambitious, WordPress provides hooks and APIs that allow you to achieve an awful lot without modifying theme files.

So what’s the child theme actually for?

We’ve been building websites exclusively with WordPress’s default themes for years, and we haven’t needed to create a child theme in all that time.

Our designers create the designs they want. We make WordPress do what they want.

Sometimes that requires a bit of creative thinking, CSS, PHP or JavaScript, but we’ve yet to encounter a design we couldn’t implement.

More importantly, our clients’ websites aren’t dependent on a child theme remaining compatible with its parent.

What if you already have a child theme?

Don’t panic. We’re not suggesting that every website using a child theme is about to break or get hacked.

But we would recommend taking a good look at what yours actually does.

You might discover that it’s making a handful of changes that could easily be transferred into Additional CSS or a small plugin.

Or you might discover that somebody has built practically the entire website inside it.

We’ve encountered both.

Either way, we’d strongly recommend making sure the parent theme is kept up to date and that somebody understands how the child theme might be affected by future changes.

And if you’d rather get rid of it altogether, that’s something we regularly do for clients. It’s often considerably less expensive than people imagine.

Good riddance to child themes?

We’ve been removing child themes from WordPress websites for years, and our opinion hasn’t changed.

We think they introduce unnecessary complexity, create maintenance headaches and, in our experience, discourage website owners from applying important theme updates.

We’ve also consistently found that removing them improves performance.

We know plenty of WordPress developers disagree with us, and that’s fine. If child themes work for you and your clients, carry on using them.

But we’re not going back.

In our previous article about why WordPress themes are dead, we explained why we believe modern WordPress has made the traditional concept of choosing a theme for its design increasingly irrelevant.

Child themes are another part of that old approach we think WordPress has outgrown.

We’ve never met one we couldn’t surgically remove.

And we can’t think of a good reason to stop trying.

What do you think? Are child themes still an essential part of WordPress development, or have they had their day? We’d be interested to hear your thoughts in the comments.

Comments …

Leave a Reply

Your email address will not be published. Required fields are marked *