How to Create a Child Theme in WordPress (Step-by-Step)
Creating a child theme in WordPress is one of the most important skills for anyone customizing a WordPress site. It protects your changes from being wiped out during theme updates — and once you understand how it works, it becomes a natural part of any WordPress workflow.
What Is a Child Theme and Why Does It Matter?
A child theme is a theme that inherits the functionality, styling, and templates of another theme — called the parent theme — while allowing you to override or extend any part of it safely.
Here's the core problem it solves: when you modify a theme's files directly and that theme updates, your changes disappear. The update overwrites the original files, including any edits you made. A child theme lives separately from the parent, so updates to the parent leave your customizations untouched.
This applies to everything from small CSS tweaks to full template overrides. Any serious WordPress site customization should run through a child theme.
What You Need Before Starting 🛠️
- A WordPress site with an existing theme installed (this becomes the parent)
- Access to your site files via FTP, a hosting file manager, or your local development environment
- Basic familiarity with WordPress's file structure
You don't need to know PHP deeply to create a basic child theme, but understanding what each file does helps you go further.
The Manual Method: Creating a Child Theme From Scratch
This is the foundational approach. It gives you full control and helps you understand what a child theme actually contains.
Step 1: Create a New Folder for the Child Theme
Navigate to /wp-content/themes/ in your site's file system. Create a new folder with a clear naming convention — typically the parent theme name followed by -child. For example, if the parent theme is twentytwentyfour, name the folder twentytwentyfour-child.
Step 2: Create the style.css File
Inside your new folder, create a file named style.css. This file must contain a specific header comment block that tells WordPress what this theme is and which parent it inherits from:
/* Theme Name: Twenty Twenty-Four Child Theme URI: https://yoursite.com Description: Child theme for Twenty Twenty-Four Author: Your Name Template: twentytwentyfour Version: 1.0.0 */ The Template field is critical — it must exactly match the folder name of the parent theme. Capitalization and spacing must be identical.
Any CSS you add below this comment block will apply to your site on top of the parent theme's styles. You don't need to re-declare all the parent's styles — they're inherited automatically.
Step 3: Create the functions.php File
Create a functions.php file in the child theme folder. This file is used to enqueue the parent theme's stylesheet properly:
<?php add_action( 'wp_enqueue_scripts', 'my_child_theme_enqueue_styles' ); function my_child_theme_enqueue_styles() { wp_enqueue_style( 'parent-style', get_template_directory_uri() . '/style.css' ); } ?> This ensures both the parent and child stylesheets load in the correct order. Some modern themes (especially block themes) handle stylesheet loading differently, but this approach covers most classic themes reliably.
Step 4: Activate the Child Theme
Go to Appearance → Themes in your WordPress dashboard. Your child theme should now appear in the list. Click Activate.
Your site will look identical to before — that's expected. You haven't overridden anything yet.
Overriding Parent Theme Files
The real power of a child theme comes from template file overrides. To override a parent template, copy that file from the parent theme folder into your child theme folder, maintaining the same directory structure. WordPress will always load the child theme's version first.
For example, if you want to customize the single post template:
- Parent path:
/themes/twentytwentyfour/single.php - Copy to:
/themes/twentytwentyfour-child/single.php - Edit your copy freely
This same principle applies to header, footer, archive, page templates, and most other theme files.
Using a Plugin Instead of Manual Setup
Several plugins automate child theme creation — Child Theme Configurator and similar tools generate the folder, style.css, and functions.php for you. These are useful for beginners or when working quickly.
The tradeoff: plugins add a dependency to your setup, and some include extra features you may not need. Manual creation involves no extra plugins and keeps your environment lean.
| Method | Best For | Trade-offs |
|---|---|---|
| Manual creation | Developers, full control | Requires file access |
| Plugin-based | Beginners, speed | Extra dependency |
| Local dev tools | Team environments | Requires setup |
Variables That Affect How Child Themes Behave 🧩
Not all WordPress setups work the same way. Several factors shape how your child theme functions in practice:
- Parent theme type — Classic PHP themes and block-based (FSE) themes handle child theme inheritance differently. Block themes use
theme.jsonfor design tokens instead of CSS variables, so your override approach changes. - Page builder integration — Sites using Elementor, Divi, or Beaver Builder may layer their own systems on top of WordPress themes. Child themes still work, but the interaction between builder output and theme files adds complexity.
- Existing customizations — If you've made changes via the Customizer or theme options, those settings are tied to the parent theme's identity. Some may carry over; others won't.
- Starter themes vs. feature-rich themes — A minimal starter theme like Underscores is designed to be extended. A heavily opinionated commercial theme may require more surgical overrides.
What Classic and Block Themes Require Differently
For classic themes, the style.css header and functions.php enqueue approach covered above works reliably.
For block themes (Full Site Editing), a child theme still needs the same style.css header — but style inheritance and template overrides work through block templates (stored in a /templates/ folder) and theme.json rather than PHP template files. Overriding a block template means copying the .html file from the parent's /templates/ directory into your child theme's /templates/ folder.
Understanding which type of parent theme you're working with determines nearly everything about how you'll structure your child theme and what files you'll be working in.