How to Create a Child Theme in WordPress? (Quick & Easy)

If you have ever customized a WordPress theme and then lost all your changes after a theme update, you are not alone. This is one of the most common and frustrating problems that WordPress beginners face. The good news is that there is a simple and reliable solution: creating a child theme.

In this guide, you will learn everything you need to know about WordPress child themes – what they are, why they matter, and how to create one step by step, even if you are a complete beginner.

What Is a WordPress Child Theme?

A child theme in WordPress is a theme that inherits all the design, layout, and functionality of another theme – called the parent theme. Think of it like a copy that is connected to the original. The child theme uses the parent theme as its foundation, but any changes you make go into the child theme only.

When the parent theme receives an update, the update only affects the parent theme files. Your child theme files remain completely untouched. This means your customizations are always safe, no matter what happens to the original theme.

To put it simply:

  • Parent theme = the original theme with all its default files
  • Child theme = your customized version that sits on top of the parent

Why Should You Use a Child Theme?

You might be wondering – why not just edit the parent theme directly? Many beginners do this at first, but it leads to a very common problem: losing all customizations when the theme is updated. Here is why using a child theme is the smarter approach:

1. Protects Your Customizations

Theme updates often overwrite all theme files. If you edited style.css or functions.php directly in the parent theme, those changes are gone the moment you click “Update.” A child theme keeps your changes in a separate location, so updates never affect them.

2. Keeps Your Site Up to Date

Theme developers release updates to fix bugs, patch security vulnerabilities, and add new features. With a child theme, you can apply these updates freely without worrying about breaking your customizations. You get the best of both worlds – a current, secure theme plus your personal modifications.

3. Makes Customization Easier and Safer

When you work inside a child theme, you only override the specific files and code that you want to change. Everything else is inherited automatically from the parent theme. This means less risk of accidentally breaking something important.

4. Perfect for Learning and Experimentation

A child theme is an ideal sandbox for developers and beginners alike. You can experiment with code changes, test new styles, and try out different layouts – all without any risk to the main theme. If something goes wrong, simply delete or revert the child theme file.

5. Organized and Professional Workflow

What Do You Need Before Creating a Child Theme?

Before you start, make sure you have the following things in place:

  • A WordPress website (self-hosted on WordPress.org)
  • A parent theme already installed and active (for example: Twenty Twenty-Four, Astra, GeneratePress, OceanWP, or any other theme)
  • Access to your website’s files via FTP or your hosting control panel’s File Manager
  • A basic text editor (Notepad on Windows, TextEdit on Mac, or a code editor like VS Code or Notepad++)
📌 Important Note: This guide is for self-hosted WordPress.org websites. WordPress.com free and lower-tier plans do not allow custom theme uploads or child themes.

How to Create a Child Theme in WordPress – Step by Step

There are two main ways to create a WordPress child theme:

  1. Manually (by creating files yourself) – recommended for learning
  2. Using a plugin (faster and beginner-friendly)

We will cover both methods in detail below.

Method 1: Create a Child Theme Manually

This is the traditional method that gives you full control. It involves creating two files: style.css and functions.php. Let us go through it step by step.

Step 1: Connect to Your Website Files

You need access to your WordPress website’s file system. There are two common ways to do this:

  • FTP (File Transfer Protocol): Use an FTP client like FileZilla. Connect using your hosting FTP credentials.
  • File Manager: Log in to your hosting control panel (cPanel, Plesk, etc.) and open the File Manager tool.

Once connected, navigate to the following folder:

public_html > wp-content > themes

This is where all your WordPress themes are stored. You should see folders for each theme currently installed on your site.

Step 2: Create a New Folder for Your Child Theme

Inside the themes folder, create a new folder. This folder will contain all your child theme files. The name should be all lowercase, with no spaces. A common convention is to use the parent theme’s name followed by “-child”.

For example, if your parent theme is called “astra”, name the child theme folder:

astra-child

Some more examples:

  • Parent: twentytwentyfour → Child folder: twentytwentyfour-child
  • Parent: generatepress → Child folder: generatepress-child
  • Parent: oceanwp → Child folder: oceanwp-child

Step 3: Create the style.css File

Inside your new child theme folder, create a new text file and name it exactly:

style.css

Open this file in your text editor and add the following code at the very top. This is called the theme header, and it tells WordPress important information about your child theme.

/*

Theme Name:   Astra Child

Theme URI:    https://yourwebsite.com

Description:  Child theme for the Astra theme

Author:       Your Name

Author URI:   https://yourwebsite.com

Template:     astra

Version:      1.0.0

License:      GNU General Public License v2 or later

License URI:  https://www.gnu.org/licenses/gpl-2.0.html

Text Domain:  astra-child

*/

Let us understand what each line means:

FieldWhat It Means
Theme NameThe display name of your child theme. You can name it anything you like.
Theme URIThe URL of your website or theme homepage (optional).
DescriptionA short description of your child theme (optional but helpful).
AuthorYour name or your company name.
Author URIYour website URL (optional).
TemplateCRITICAL – must exactly match the parent theme folder name (all lowercase).
VersionThe version number of your child theme. Start with 1.0.0.
Text DomainUsed for translations. Usually the same as the child theme folder name.
⚠️ Critical: The Template field must exactly match the folder name of your parent theme (not the theme’s display name). Go to your themes folder and check the exact folder name. Even one wrong character will break the connection.

Step 4: Create the functions.php File

The style.css file by itself does not automatically load the parent theme’s styles. You need a functions.php file in your child theme to properly enqueue (load) both the parent and child stylesheets.

Create a new file in your child theme folder and name it:

functions.php

Add the following code inside it:

<?php

add_action( ‘wp_enqueue_scripts’, ‘astra_child_enqueue_styles’ );

function astra_child_enqueue_styles() {

    // Enqueue parent theme stylesheet

    wp_enqueue_style(

        ‘parent-style’,

        get_template_directory_uri() . ‘/style.css’

    );

    // Enqueue child theme stylesheet

    wp_enqueue_style(

        ‘child-style’,

        get_stylesheet_directory_uri() . ‘/style.css’,

        array( ‘parent-style’ ),

        wp_get_theme()->get( ‘Version’ )

    );

}

Here is what each part of this code does:

  • add_action() hooks your function into WordPress’s script loading process
  • wp_enqueue_style() tells WordPress to load a CSS file
  • get_template_directory_uri() gets the URL to the parent theme folder
  • get_stylesheet_directory_uri() gets the URL to the child theme folder
  • array(‘parent-style’) tells WordPress to load the parent styles first
💡 Pro Tip: Some themes (like Astra and GeneratePress) handle stylesheet loading differently. If the parent theme uses wp_enqueue_scripts itself or loads styles via functions.php rather than style.css, you may not need to enqueue the parent style. Always check the parent theme’s documentation.

Step 5: Create a Screenshot (Optional but Recommended)

A screenshot helps you identify your child theme visually in the WordPress admin area. Create an image of your website design or a simple placeholder graphic and save it as:

screenshot.png

The recommended size for a theme screenshot is 1200 x 900 pixels. Place this file inside your child theme folder. Without a screenshot, WordPress will show a grey placeholder in the Appearance > Themes area.

Step 6: Upload the Child Theme Folder

If you created the files locally on your computer, you now need to upload the entire child theme folder to your server. Using FTP or File Manager, upload the folder to:

wp-content/themes/

Make sure the entire folder is uploaded with both files inside it (style.css and functions.php, plus screenshot.png if you created one).

Step 7: Activate the Child Theme

Now it is time to activate your child theme in WordPress:

  1. Log in to your WordPress admin dashboard
  2. Go to Appearance > Themes
  3. Find your newly uploaded child theme in the list
  4. Hover over it and click Activate

Your website will now run on the child theme. Visually, it should look identical to the parent theme because no customizations have been added yet – the child theme is simply inheriting everything from the parent.

✅ Success Check: After activating the child theme, visit your website in a browser. It should look exactly the same as before. If something looks broken, double-check the Template field in your style.css to make sure it exactly matches the parent theme folder name.

Method 2: Create a Child Theme Using a Plugin

If the manual method feels too technical, do not worry. There are plugins that can create a child theme for you in just a few clicks. The most popular one is Child Theme Configurator.

Using the Child Theme Configurator Plugin

  1. From your WordPress admin dashboard, go to Plugins > Add New
  2. Search for “Child Theme Configurator” in the search box
  3. Click Install Now next to the plugin by Lilaea Media, then click Activate
  4. Go to Tools > Child Themes in your admin dashboard
  5. Select your parent theme from the dropdown menu
  6. Choose a name for your child theme
  7. Click the Analyze button to let the plugin scan the parent theme
  8. Click Create New Child Theme

The plugin will automatically create the required style.css and functions.php files with all the correct settings. It also gives you options to copy menus, widgets, and other settings from the parent theme.

After creation, go to Appearance > Themes and activate your new child theme just as described in the manual method above.

📌 Note: While plugins make child theme creation faster and easier, understanding the manual method gives you a much deeper understanding of how WordPress themes work. Both approaches produce the same result.

How to Customize Your Child Theme

Now that your child theme is active, it is time to start adding your customizations. Here are the most common ways to modify a child theme:

1. Adding Custom CSS Styles

The easiest way to change how your website looks is to add CSS styles directly to your child theme’s style.css file. Any CSS rule you add here will override the parent theme’s styles.

For example, to change the background color of your website:

body {

    background-color: #f5f5f5;

}

To change the color and size of your main heading:

h1 {

    color: #2563eb;

    font-size: 36px;

}

Because the child theme stylesheet is loaded after the parent stylesheet, your styles take priority. This is the cascade in CSS – later styles win over earlier ones.

2. Overriding Template Files

WordPress themes are made up of PHP template files that control what content appears on different types of pages. For example:

  • header.php – controls the header area
  • footer.php – controls the footer area
  • single.php – controls individual blog post pages
  • page.php – controls static pages
  • archive.php – controls archive and category pages
  • index.php – the main fallback template

To override any of these files in your child theme, simply copy the file from the parent theme folder into your child theme folder and then edit it. WordPress will automatically use the child theme version instead of the parent version.

For example, to customize the footer:

  1. Find footer.php in the parent theme folder
  2. Copy it to your child theme folder
  3. Open the child theme’s footer.php and make your changes
💡 Best Practice: Only copy and override the template files you actually need to change. The fewer files you override, the easier it is to maintain your child theme and benefit from parent theme updates.

3. Adding Custom PHP Functions

The functions.php file in your child theme is a powerful place to add custom functionality. Any function you add here is loaded on top of the parent theme’s functions.php.

For example, to add a custom message in the footer of every page:

function my_custom_footer_text() {

    echo ‘<p>Custom footer text goes here.</p>’;

}

add_action( ‘wp_footer’, ‘my_custom_footer_text’ );

You can also use functions.php to:

  • Register new widget areas
  • Add custom post types
  • Enqueue additional scripts and stylesheets
  • Remove features from the parent theme
  • Filter content or modify output
⚠️ Caution: The functions.php file in the child theme does NOT replace the parent theme’s functions.php – both are loaded. This means you cannot use the same function name twice. If a function already exists in the parent theme, use a different name or use remove_action() / remove_filter() to unhook the parent function first.

4. Using the WordPress Customizer

Many WordPress themes support the built-in WordPress Customizer (Appearance > Customize). Any changes you make in the Customizer are stored in the database as theme options, not in theme files. This means Customizer changes are saved separately from theme files and are not affected by child theme creation.

If your parent theme has Customizer options for colors, fonts, layouts, and similar settings, you can use them freely with or without a child theme. Your Customizer settings will persist even when you switch between parent and child theme, as long as they share the same theme slug.

Understanding How WordPress Loads Child Theme Files

It is helpful to understand the order in which WordPress loads files when you have a child theme active. This explains why child theme customizations always take priority.

Here is the loading order:

  1. WordPress loads the child theme’s functions.php first
  2. Then it loads the parent theme’s functions.php
  3. When a template is needed, WordPress checks the child theme folder first
  4. If the template is not found in the child theme, WordPress uses the parent theme’s version
  5. CSS: the parent stylesheet loads first, then the child stylesheet (child styles override parent)

This loading order is the foundation of how child themes work. It allows you to selectively override only what you need, while inheriting everything else from the parent theme automatically.

Common Mistakes to Avoid When Creating a Child Theme

Here are some of the most common errors that beginners make when creating a child theme, and how to avoid them:

Mistake 1: Wrong Template Name in style.css

The Template field in your style.css must exactly match the parent theme’s folder name. If it says “Astra” instead of “astra”, or if there is a typo, the child theme will not connect to the parent properly and your site may break.

Always verify the parent theme folder name by checking wp-content/themes/ directly.

Mistake 2: Not Enqueueing Stylesheets Correctly

A very old method of loading parent styles was to use @import in style.css like this:

@import url(‘../parenttheme/style.css’);

This method is outdated and slow because it creates an extra HTTP request. The correct approach is to use wp_enqueue_style() in functions.php as shown in the step-by-step guide above.

Mistake 3: Editing the Wrong Files

After setting up the child theme, always make sure you are editing files in the child theme folder, not the parent theme folder. It is easy to accidentally open the wrong file, especially if both parent and child share similar file names.

Mistake 4: Creating a Child Theme of a Child Theme

WordPress does not support multi-level child themes (a child of a child). If you need to customize a child theme further, do all your customizations within the same child theme. Do not try to create a second child theme on top of an existing one.

Mistake 5: Forgetting to Activate the Child Theme

After uploading the child theme files, many beginners forget to go to Appearance > Themes and activate the child theme. Your customizations will have no effect unless the child theme is the active theme on your WordPress site.

Troubleshooting Common Child Theme Problems

Even with careful setup, things can occasionally go wrong. Here are solutions to the most common child theme problems:

Problem: White Screen or Site Looks Broken After Activation

This usually means there is a PHP error in your functions.php file. Check for:

  • Missing semicolons at the end of PHP statements
  • Unclosed curly braces { }
  • Typos in function names

To fix this, connect via FTP and rename or delete the functions.php file temporarily to restore access to your site.

Problem: Child Theme Not Showing in Themes List

WordPress requires at minimum a style.css file with a valid Theme Name and Template header in the child theme folder. If the theme does not appear in the themes list, check that:

  • The style.css file exists in the child theme folder
  • The Theme Name field is present in the header comment
  • The Template field matches the parent theme folder name exactly

Problem: Styles from Parent Theme Are Not Loading

If your site looks completely unstyled after activating the child theme, it means the parent stylesheet is not being enqueued. Review your functions.php file and make sure the wp_enqueue_style code is correct and includes the parent style.

Problem: Changes in style.css Are Not Appearing

This is usually a browser caching issue. Try:

  • Hard refreshing your browser (Ctrl+Shift+R on Windows, Cmd+Shift+R on Mac)
  • Clearing your browser cache
  • Using incognito/private browsing mode

Child Theme File Structure – A Quick Overview

Here is what a complete, well-structured child theme folder looks like:

astra-child/

├── style.css          (Required – theme header and custom styles)

├── functions.php      (Required – enqueue styles and add functions)

├── screenshot.png     (Optional – theme preview image)

├── header.php         (Optional – overrides parent header template)

├── footer.php         (Optional – overrides parent footer template)

├── single.php         (Optional – overrides single post template)

├── page.php           (Optional – overrides static page template)

└── js/

    └── custom.js      (Optional – custom JavaScript file)

You only need style.css and functions.php to get started. All other files are optional and added only when you need to override specific parts of the parent theme.

Child Themes and Block Themes (Full Site Editing)

WordPress 5.9 and later introduced Full Site Editing (FSE) with block themes. Block themes work a little differently from classic themes. If your parent theme is a block theme (such as Twenty Twenty-Three, Twenty Twenty-Four, or Kadence Blocks Theme), the child theme setup is slightly different.

For block themes:

  • You still create the same style.css with the theme header
  • The functions.php file for enqueueing is optional (block themes handle this differently)
  • Customizations are done mainly through theme.json, which is a JSON file that controls colors, typography, spacing, and layout settings
  • Template overrides are stored in the templates/ and parts/ folders as HTML files

For example, a block theme child theme might look like this:

twentytwentyfour-child/

├── style.css

├── theme.json         (Customizes design tokens)

└── templates/

    └── single.html    (Overrides the single post template)

If you are using a classic (non-block) theme, the method described in this guide works perfectly. If you are using a block theme, be aware that the Full Site Editor in your admin dashboard (Appearance > Editor) is where most visual customizations happen.

Best Practices for Working With Child Themes

To make the most of your child theme and keep your site running smoothly, follow these best practices:

  • Comment your code: Add comments to your CSS and PHP to explain what each section does. This helps when you or someone else revisits the code later.
  • Keep the child theme minimal: Only override the files and functions you actually need to change. The less you override, the more your site benefits from parent theme updates.
  • Document your changes: Keep a simple text file or changelog inside your child theme folder noting what you changed and why. This is invaluable for troubleshooting.
  • Test after every parent theme update: After updating the parent theme, always check your site’s frontend to make sure nothing unexpected broke.
  • Use child theme for all customizations: Never edit the parent theme directly, even for “just one small change.” Always make changes in the child theme.

Conclusion

Creating a child theme in WordPress is one of the most valuable skills you can develop as a website owner or developer. It protects your hard work from being wiped out by theme updates, keeps your site secure and current, and gives you the freedom to customize without limits.

As you have seen in this guide, the process is not complicated at all. With just two files – style.css and functions.php – you can create a fully functional child theme in a matter of minutes. From there, the sky is the limit for customizations.

Whether you choose the manual method or use a plugin, the important thing is that you make the switch to child themes as part of your regular WordPress workflow. Your future self – the one who just clicked “Update Theme” and found all customizations intact – will thank you for it.

Start with the basic setup, get comfortable, and then gradually explore adding custom CSS, overriding template files, and adding functions. With practice, working with child themes will become second nature.

Frequently Asked Questions (FAQ)

Can I use a child theme with any WordPress theme?

Yes, you can create a child theme for almost any WordPress theme as long as it is a well-coded theme that follows WordPress standards. Most popular themes like Astra, GeneratePress, OceanWP, Divi, Avada, and all default WordPress themes support child themes.

Will creating a child theme slow down my website?

Do I need a child theme if I only use the Customizer?

If all your customizations are made through the WordPress Customizer or a page builder, you technically do not need a child theme because those changes are stored in the database, not in theme files. However, it is still a good habit to use a child theme in case you ever need to make code-level changes.

What happens to my child theme if the parent theme is deleted?

If you delete the parent theme, your child theme will lose its styles and functionality because it depends on the parent. Always keep the parent theme installed, even if you never activate it directly. WordPress also protects against accidental parent theme deletion by warning you if an active child theme relies on it.

Can I create a child theme from scratch without a parent?

No. By definition, a child theme requires a parent theme to inherit from. What you are describing – a standalone theme built from scratch – is a parent theme itself. Child themes are specifically designed to extend and modify existing themes.

Is it possible to have multiple child themes for the same parent?

Yes, you can have multiple child themes all pointing to the same parent theme. For example, you might have astra-child-blue and astra-child-red, each with different color schemes. However, only one child theme can be active at any given time.

Happy WordPress customizing!

Scroll to Top