How to Create a WordPress Child Theme Before Customizing Your Website

Every WordPress theme can be updated by its developer at any time, and when that update runs, it overwrites the theme files entirely — including any changes you’ve made directly. If you’ve customised a header template, tweaked a layout file, or added CSS straight into the theme’s stylesheet, that work disappears the moment the update lands. There’s no warning and no recovery; the updater doesn’t check what you’ve changed.

A child theme is the way around this. It sits as a separate layer on top of your main theme, inheriting all its design and functionality while keeping your customisations in their own protected space that the parent theme’s updater never touches. It’s something worth setting up before making any code-level changes — it takes about ten minutes and saves real frustration later.

What You Need Before Starting

You’ll need FTP access or your host’s file manager to create files in the themes directory, and you need the exact folder name of your current theme — not its display name. Go to Appearance → Themes, hover over your active theme, and note the folder name shown; that’s the value you’ll use in the child theme files.

Creating the Child Theme Files

In /wp-content/themes/, create a new folder named something like yourtheme-child, replacing yourtheme with the actual parent folder name — this naming convention makes it immediately clear which theme the child belongs to.

Inside it, create a style.css file with this at the very top:

/*
Theme Name: Your Theme Child
Template: yourtheme
*/

Theme Name is the label shown in the WordPress admin — set it to anything. Template must exactly match the parent theme’s folder name, including capitalisation; off by even one character, and WordPress won’t recognise the parent-child relationship at all.

Next, create functions.php in the same folder:

<?php
function child_theme_enqueue_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'child_theme_enqueue_styles' );

This is the step most tutorials present as universally mandatory, but it isn’t always necessary any more. The official WordPress Theme Handbook now states this enqueue step is “often not needed for block themes because their style handling is generally done via theme.json” — for a block theme like Twenty Twenty-Five (WordPress’s own current default), the parent’s stylesheet frequently loads automatically without it. Whether that’s true for your specific parent theme depends entirely on how that theme’s developer built it, so there’s no way to know without testing. Including the functions.php step regardless costs nothing and is the one approach guaranteed to work across both classic and block themes — it’s the safe universal default, just no longer a strict requirement on every theme.

For a block theme, there’s a second option worth knowing about: a child theme can consist of nothing but style.css and a theme.json file, with no PHP at all. WordPress merges a child theme’s theme.json into the parent’s, with the child’s values taking precedence — so a child theme that includes only a colour palette or a typography setting overrides just that piece of the parent, while everything else still inherits normally. It’s a genuinely different mechanism from the classic override-a-template-file approach, and it’s the more natural fit if all you actually want to change is a colour, a font, or a spacing value rather than markup or logic.

Activating and Testing

Go to Appearance → Themes, find the child theme listed alongside your others, and click Activate. Check your site immediately — it should look exactly as it did before. If something looks different, missing styles or a broken layout, the most common cause is a mismatch in the Template value; double-check it matches the parent folder name precisely, or that the parent theme actually needed the manual enqueue step described above.

From here, every future change — custom CSS, template file overrides, additional PHP functions — goes into the child theme files, never the parent. To add CSS, edit the child theme’s style.css or enqueue a separate stylesheet; adding custom CSS in WordPress walks through each method and when to use one over another. To override a template file, copy it from the parent theme into the matching relative path inside the child folder and edit your copy — WordPress automatically prefers the child theme version once it exists. The WordPress Theme Handbook covers the full file hierarchy and inheritance rules if you want the deeper mechanics.

Keeping the Child Theme Lean

Only copy files you actually need to change — a child theme with one modified file is simpler to manage than one with thirty copied “just in case,” since the parent handles everything you haven’t overridden. Keep theme-specific functionality (CSS, layout tweaks) in the child’s functions.php; anything that should work regardless of which theme is active, like a custom post type, belongs in a plugin instead. And check child theme support before committing significant work to a theme — most well-maintained themes support it cleanly, but some page-builder-specific themes behave differently, so it’s worth confirming early. Choosing a WordPress theme covers what to check before you commit to one.

Mistakes That Break a Child Theme

Wrong folder name in Template. The value must be the parent theme’s exact directory name, not its display name — if your theme shows as “Astra” in the admin panel, its folder is very likely astra, lowercase. Check the actual folder. Editing parent theme files anyway — having a child theme doesn’t stop you from accidentally opening a parent file, so get in the habit of checking which file you’re editing before saving. Skipping the parent stylesheet enqueue on a classic theme — for a traditional PHP-template theme this step genuinely is required, and if your site looks completely unstyled right after activation, this is almost always why. Confusing Theme Name with Template — the first is just an admin label, the second is a directory reference that must match exactly.

When You Don’t Need a Child Theme at All

If you’re only adding small CSS tweaks — colours, spacing, font sizes — the Additional CSS field under Appearance → Customise works fine and survives theme updates by default, no child theme required. If you’re using a page builder like Elementor or Beaver Builder, most layout changes live in the database rather than theme files, so those also survive updates untouched.

A child theme earns its place specifically when you’re editing PHP template files, making significant changes to functions.php, or doing anything that has to live inside the theme directory to function. Most sites reach that point quickly once they move past a basic setup — set the child theme up before you get there, not after. For everything else involved in building a well-structured site, the step-by-step guide to building a WordPress website covers the full process from choosing a host to going live.