Key Takeaways
- A child theme is a separate, connected theme that inherits all the styling and functionality of a parent theme while letting you make your own customizations in a completely separate location that theme updates never touch.
- Without a child theme, any customization made directly to a theme’s own files, whether that is custom CSS, a modified template, or added PHP functionality, is silently overwritten the moment that theme receives an update, which is one of the most common and most avoidable ways WordPress customizations get lost.
- Creating a child theme manually requires only two files, a style.css file with a specific header connecting it to the parent theme, and a functions.php file that properly loads the parent theme’s styles, both of which this guide provides in full, ready to use.
- Many popular themes, including Kadence and Astra, offer a one click child theme generator directly within their own settings, which is the fastest and least error prone method for most WordPress users.
- A child theme only needs to contain the specific files you are actually customizing. Everything you do not modify continues to be served automatically from the parent theme, meaning a child theme can be as small as two files or as extensive as needed.
- This guide walks through exactly why a child theme matters, the manual creation process with complete, working code, the plugin based alternative, and how to actually use your child theme once it exists to make safe, update-proof customizations going forward.
Introduction
Making direct changes to a WordPress theme’s own files feels like the fastest path to the specific customization you want, until the theme releases its next update and every change you made disappears without warning, replaced by the developer’s fresh, unmodified files. This is one of the most common and most entirely preventable frustrations in WordPress, and the fix has existed since long before it became a widespread problem, a child theme, which lets your customizations live in a genuinely separate location that no parent theme update will ever touch.
This guide walks through exactly what a child theme is and why it matters, the complete manual creation process with working code you can copy directly, the faster plugin based alternative many WordPress users prefer, and how to actually put your new child theme to use once it exists.
What You Will Learn
In this guide, you’ll learn:
- Understand exactly what a child theme is and why direct customizations to a parent theme are lost during updates.
- Be able to create a working child theme manually, using the complete code provided in this guide.
- Know how to create a child theme using a plugin based method as a faster alternative.
- Understand how to actually add your own CSS, template overrides, and PHP functionality to your new child theme.
- Know the common mistakes that cause a child theme to fail to activate or display correctly.
What a Child Theme Actually Is
A child theme is a genuinely separate WordPress theme that is explicitly connected to an existing parent theme, inheriting all of that parent theme’s templates, styling, and functionality by default, while allowing you to override or add to any specific part of it within the child theme’s own, entirely separate files.
When WordPress loads a child theme, it looks first within the child theme’s own folder for any given file or piece of functionality. If the child theme does not contain a specific file, WordPress automatically falls back to using that same file from the parent theme instead. This means a child theme does not need to duplicate the entire parent theme. It only needs to contain the specific files corresponding to whatever you are actually customizing, and everything else continues to be served directly and automatically from the parent theme with no additional work required on your part.
This structure is what makes child themes safe from updates in a way that direct theme editing never can be. When the parent theme releases an update, WordPress replaces the parent theme’s own files entirely, but your separate child theme folder, sitting independently alongside it, is completely untouched by that update process, meaning any customization you placed there survives indefinitely regardless of how many times the parent theme itself is updated afterward.
Why This Matters: What Happens Without a Child Theme
If you edit a parent theme’s files directly, whether that is adding custom CSS to its style.css file, modifying one of its template files, or adding custom PHP functionality to its functions.php file, those changes exist only within the parent theme’s own files. The moment that theme receives an update through the WordPress dashboard, every one of those files is replaced entirely with the developer’s fresh version, silently erasing any customization you made with no warning and, in most cases, no way to recover the lost changes afterward.
This single risk is significant enough that using a child theme for any genuine customization, however small, is considered a firm best practice within the WordPress community, and it applies even to something as minor as a single custom CSS rule, since even a small, one line customization made directly to a parent theme is lost in exactly the same way as a much larger change would be.
Method 1: Creating a Child Theme Manually
This method requires no additional plugin and gives you complete, direct control over exactly what your child theme contains. It requires creating two files and uploading them to your WordPress installation.
Step 1: Create a New Folder for Your Child Theme
Using an FTP client such as FileZilla, or your hosting provider’s File Manager, navigate to your WordPress installation’s theme directory, located at `wp-content/themes/`. Create a new folder here for your child theme, named after your parent theme with `-child` added to the end, for example `astra-child` if you are creating a child theme for Astra, or `kadence-child` if your parent theme is Kadence.
Step 2: Create the style.css File
Inside your new child theme folder, create a new file named exactly `style.css`. This file requires a specific header comment block that WordPress reads to understand the child theme’s relationship to its parent. Copy the following code exactly, replacing the placeholder values with your own theme’s specific details:
“`css
/*
Theme Name: Astra Child
Theme URI: https://yourdomain.com
Description: Child theme for Astra
Author: Your Name
Author URI: https://yourdomain.com
Template: astra
Version: 1.0.0
*/
“`
The single most important line in this entire file is `Template: astra`. This value must exactly match the folder name of your actual parent theme, exactly as it appears in your `wp-content/themes/` directory, with correct capitalization. If your parent theme’s folder is named `kadence`, this line must read `Template: kadence`. Getting this single value wrong is the most common reason a child theme fails to activate correctly or displays a warning that the parent theme is missing.
Below this header comment block, you can add any custom CSS rules you want to apply on top of your parent theme’s existing styles. For now, a comment block alone is sufficient to create a working, empty child theme.
Step 3: Create the functions.php File
Inside the same child theme folder, create a second new file named exactly `functions.php`. This file is what properly loads your parent theme’s original stylesheet, since simply creating a child theme does not automatically include the parent’s CSS on its own. Copy the following code exactly:
“`php
<?php
add_action( ‘wp_enqueue_scripts’, ‘sitelaunchlab_child_enqueue_styles’ );
function sitelaunchlab_child_enqueue_styles() {
wp_enqueue_style(
‘parent-style’,
get_template_directory_uri() . ‘/style.css’
);
}
“`
This code hooks into WordPress’s script and style loading process and specifically tells it to load the parent theme’s own style.css file alongside your child theme’s style.css file, ensuring your site displays with the parent theme’s full original styling as the foundation, with anything you add to your child theme’s own style.css layered on top of it.
Step 4: Upload Your Child Theme Folder
If you created these two files locally rather than directly on the server, upload the entire child theme folder, containing both style.css and functions.php, to your `wp-content/themes/` directory using FTP or your hosting provider’s File Manager.
Step 5: Activate Your Child Theme
Log in to your WordPress dashboard and navigate to Appearance, then Themes. Your new child theme should now appear in the list, displaying the theme name you specified in the style.css header. Click Activate.
Your site should now display exactly as it did before, since an empty child theme with no additional customizations inherits everything from the parent theme by default. This is the expected, correct result, confirming your child theme is properly connected and functioning before you add any actual customizations to it.
Method 2: Creating a Child Theme With a Plugin
For a faster, less error prone alternative to manually creating and uploading files, several free plugins can generate a working child theme directly from within your WordPress dashboard.
Install and activate a child theme generator plugin such as Child Theme Configurator, available for free in the WordPress plugin repository. Once activated, navigate to the plugin’s own menu, typically found under Tools or as its own dedicated menu item.
Select your currently active parent theme from the plugin’s dropdown list of installed themes. Configure any basic options the plugin presents, such as the child theme’s name, and click the option to generate and create the child theme.
The plugin automatically creates the correct style.css and functions.php files with the proper header values and parent theme connection, and in most cases can activate the new child theme directly for you, removing any risk of a manual typo in the critical Template line that connects the child theme to its parent.
Many popular themes also include this capability built directly into their own settings without requiring a separate plugin at all. Kadence and Astra, both frequently recommended on this site, include a one click child theme creation option within their own theme settings panel, making this the fastest and most reliable method whenever your specific parent theme supports it directly.
How to Actually Use Your Child Theme
Once your child theme is active, any customization work should happen exclusively within its files, never within the parent theme’s own files, which remain untouched and ready to be safely updated at any time going forward.
Adding Custom CSS
Add any custom CSS rules directly into your child theme’s style.css file, below the header comment block. These rules are loaded after the parent theme’s own stylesheet, meaning your custom rules will override the parent theme’s default styling for any selector you specifically target, without needing to modify a single line of the parent theme’s own files.
Overriding a Specific Template File
If you need to modify a specific template file, such as how a single post displays or how your header is structured, copy that exact file from the parent theme’s folder into the identical file path within your child theme’s folder. WordPress will automatically use your child theme’s copy instead of the parent theme’s original, and you can then safely edit that copied file within your child theme however you need, while the original file remains untouched within the parent theme.
Adding Custom PHP Functionality
Add any additional custom PHP functions directly into your child theme’s functions.php file, below the existing code that loads the parent theme’s stylesheet. Unlike template files, your child theme’s functions.php file does not replace the parent theme’s functions.php entirely, it runs in addition to it, meaning both the parent theme’s original functions and anything you add in your child theme’s functions.php will execute together.
Common Mistakes That Prevent a Child Theme From Working
Mismatching the Template line in style.css with the actual parent theme folder name is the single most common cause of a child theme failing to activate correctly or displaying a broken, unstyled site. Double check this value matches your parent theme’s exact folder name, including capitalization, character for character.
Forgetting to properly enqueue the parent theme’s stylesheet within functions.php results in a child theme that activates without error but displays with none of the parent theme’s actual styling, appearing as a completely unstyled, broken looking site. Confirm the functions.php code provided in this guide is present and unmodified.
Editing the parent theme directly out of habit even after a child theme has been created and activated is a subtle but common mistake, particularly for anyone accustomed to editing theme files before adopting the child theme approach. Once your child theme is active, make a deliberate habit of navigating specifically to your child theme’s folder for any future customization work, rather than defaulting back to the parent theme’s files.
Frequently Asked Questions
Will creating a child theme slow down my website?
No, a properly configured child theme adds a negligible amount of overhead, since it is simply loading an additional, typically very small stylesheet alongside the parent theme’s existing styles, which has no meaningful impact on page load speed.
Do I need a child theme if I am only using the WordPress Customizer and not editing code directly?
Customizations made through the built in WordPress Customizer, such as color and typography settings provided directly by your theme, are generally stored separately in the database and are typically preserved through theme updates on their own. A child theme becomes specifically necessary once you are adding custom CSS, modifying template files directly, or adding custom PHP functionality beyond what the Customizer itself provides.
Can I update my parent theme after creating a child theme without losing my customizations?
Yes, this is the entire purpose of a child theme. Updating the parent theme replaces only the parent theme’s own files, while your separate child theme folder and everything you have added to it remain completely untouched by that update process.
What if my theme does not have a one click child theme generator built in?
Use either the manual method described in this guide, copying the two required files with the correct header values, or a dedicated child theme generator plugin such as Child Theme Configurator, both of which work with any properly structured WordPress theme regardless of whether that specific theme includes its own built in generator.
Can I have more than one child theme for the same parent theme?
Yes, though this is uncommon in practice, since most sites only need a single child theme at a time. Each child theme would need its own uniquely named folder and its own style.css header specifying the same parent theme in its Template line.
Does a child theme need to include every file from the parent theme?
No, and this is one of the most important things to understand about how child themes work. A child theme only needs to include the specific files you are actually customizing. Any file not present in your child theme folder is automatically loaded from the parent theme instead, meaning a functional child theme can consist of as few as the two files described in this guide.
Related Articles
- How WordPress Works: Posts, Pages, Themes, Plugins and the Loop
- WordPress Gutenberg Editor: The Complete Beginner’s Guide
Final Thoughts
A child theme is one of the smallest, fastest pieces of WordPress setup work that pays off disproportionately the moment your theme receives its first update after you have made any genuine customization. Whether you build it manually using the two files provided in this guide, or generate it instantly through a plugin or your theme’s own built in tool, the underlying protection is identical, your customizations live in a separate, update-proof location that no parent theme update will ever touch.
Create your child theme before you make your first customization, not after you have already lost one to an update, and make it a consistent habit to work exclusively within your child theme’s files going forward. It is a small amount of setup effort that removes an entire category of frustrating, entirely avoidable WordPress problems permanently.

The SiteLaunchLab Team — helping beginners build websites, choose the right hosting, and grow their online business. We research, test, and review the best tools and platforms so you can make confident decisions without the confusion.