How to Create a WordPress Child Theme (and When You Need One)

How to Create a WordPress Child Theme (and When You Need One)

You customise your WordPress theme, adding a few lines of CSS to its stylesheet and a function to its functions.php. Then the theme updates and every change disappears. A WordPress child theme prevents this. It sits on top of your main theme, inherits its design and holds your customisations separately, so theme updates never overwrite your work.

In this guide, you’ll learn when you need a child theme, how to create one in a few minutes, and when a simpler option is better.

What Is a Child Theme?

A child theme is a small theme that depends on another theme, called the parent. WordPress loads the parent’s templates and styles first, then applies anything in the child. You update the parent as normal; your changes stay in the child.

Do You Need a Child Theme?

You want to… Best option
Add a little custom CSS Appearance → Customize → Additional CSS, or the Site Editor’s styles
Add a PHP snippet that isn’t design-related A small custom plugin
Override theme template files Child theme
Make many design changes in code Child theme
Change layouts in a block theme The Site Editor (changes are saved separately from theme files)

Rule of thumb: if you’re editing theme files, use a child theme. If you’re not, you may not need one.

How to Create a Child Theme

Step 1: Create the Folder

Connect to your site with SFTP or your host’s File Manager and go to wp-content/themes. Create a new folder, for example mytheme-child.

Step 2: Add style.css

Create a file called style.css in the new folder with this header. The Template line must match the parent theme’s folder name exactly:

/*
Theme Name: My Theme Child
Template: mytheme
Version: 1.0
*/

Step 3: Add functions.php

Create functions.php to load the parent theme’s stylesheet:

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

Many modern themes load their own styles correctly for child themes, in which case this step is optional. Check the parent theme’s documentation.

Step 4: Activate It

Go to Appearance → Themes and activate the child theme. Your site should look exactly the same. Check menus and widgets, as some themes store settings per theme and may need re-assigning.

Step 5: Add Your Customisations

  • Put custom CSS in the child’s style.css.
  • Put theme-related PHP in the child’s functions.php.
  • To override a template, copy the file from the parent into the child, keeping the same folder structure, and edit the copy.

Want a fully custom theme, or help moving years of hacked theme edits into a clean child theme? Simpli Plugin’s team builds and refactors WordPress themes.

Talk to Our Developers →

Child Theme Best Practices

  • Only override what you change. Every copied template is one you must maintain.
  • Keep functionality out of the theme. Features like custom post types belong in a plugin, so they survive a theme change.
  • Use version control such as Git for your child theme files.
  • Test parent updates on staging before updating the live site.

Common Problems and How to Fix Them

The Site Loses Its Styling

The parent stylesheet isn’t loading. Check the Template line in style.css and the enqueue code in functions.php.

“The parent theme is missing”

The Template value doesn’t match the parent’s folder name. It’s case-sensitive.

Re-assign them under Appearance → Menus and Widgets; they’re tied to the active theme.

Frequently Asked Questions

Do block themes support child themes?

Yes. You can override templates and theme.json settings in a child of a block theme, although many changes can be made directly in the Site Editor.

Will a child theme slow down my site?

No. The overhead is negligible.

Can I switch to a child theme on a live site?

Yes, but do it at a quiet time and check menus, widgets and customiser settings straight away.

Customise Without Fear of Updates

A child theme keeps your design changes safe while the parent theme stays up to date. Create one when you edit theme files, keep it lean and move features into plugins.

Browse the free Simpli Plugin library for features you’d otherwise hard-code in a theme, and join the template waitlist.

Request a Custom Theme →