A child theme lets you change how your site looks and behaves without touching the parent theme’s files, so every future update leaves your work intact. This guide shows you how to create a child theme in WordPress three ways (by hand, with a plugin and with our free child theme generator), including a Divi child theme and a block child theme, with copy-paste code you can trust.
- Create a folder in
wp-content/themes/namedyourtheme-child. - Add a
style.csswith a header that containsTemplate: parent-folder-name. - Add a
functions.phpthat enqueues the parent and child stylesheets. - Go to Appearance → Themes and activate the child theme.
Prefer no code? Use the free child theme generator below or the Child Theme Configurator plugin.
What is a WordPress child theme?
A WordPress child theme is a small theme that depends on another theme, called the parent theme. It inherits the parent’s templates, styling and features, and it only stores the changes you make. Think of the parent as a finished house and the child theme as your renovation plans: you never knock down the original walls, you simply layer your own decisions on top.
Technically, WordPress reads the child theme first. If a file exists in both places (for example single.php), the child theme’s version wins. If a file exists only in the parent, WordPress falls back to it. That single rule explains almost everything about how a child theme works.
Why use a child theme (and when you can skip it)
Editing a theme directly feels faster, until the next update overwrites every change. Security and compatibility updates are not optional, so you either lose your work or stop updating. A child theme removes that dilemma.
Use a child theme when you want to…
- Change CSS beyond a few small tweaks
- Edit or replace template files such as
header.php,footer.phporsingle.php - Add PHP functions or hooks that are tied to the theme’s design
- Override WooCommerce templates for the cart, checkout or product pages
- Keep every customization in one place, easy to back up and to version
You can skip it when…
- You only need a few lines of CSS. Use the Customizer’s Additional CSS instead (see our guide to adding custom CSS in WordPress).
- The code is not theme-specific, such as custom post types, shortcodes or taxonomies. Those belong in a plugin so they survive a theme switch. A snippets plugin works well, and we compare options in our list of code snippets plugins for WordPress.
- You build everything with a visual builder and never touch theme files.
WordPress child theme foundations: files and structure
Every child theme is built on the same foundations. Understanding them makes the steps below feel obvious rather than magical.
| File | Purpose | Required? |
|---|---|---|
style.css |
Header comment tells WordPress this is a child theme and names the parent through Template:. Your custom CSS goes below it. |
Yes |
functions.php |
Loads the parent and child stylesheets and holds your PHP customizations. Unlike template files, it runs in addition to the parent’s functions.php, not instead of it. | Practically yes |
| Template files | Copies of parent files you want to change. Keep the same file name and folder path. | Optional |
screenshot.png |
Thumbnail shown in Appearance → Themes. | Optional |
theme.json |
Design settings for block child themes. It merges with the parent’s theme.json. | Block themes only |
The line that matters most is Template:. Its value must match the parent theme’s folder name exactly, including capitalization. If it is wrong, WordPress reports a missing parent and the theme will not activate.
Before you start: a quick checklist
- Back up your site. Files and database. Always.
- Use a staging site or a local install. If you do not have one, our guide to running WordPress on localhost gets you set up quickly.
- Find the parent’s folder name. Look in
wp-content/themes/through FTP or your hosting file manager. - Check whether your theme author already ships a child theme. Astra, GeneratePress, OceanWP, Kadence and Hello Elementor all offer one.
- Keep the parent theme installed. The child theme cannot run without it.
The best method to create a child theme in WordPress
There is no single winner, so choose by your situation. This beginner’s guide to creating a WordPress child theme compares the four realistic options.
| Method | Skill level | Time | Best for |
|---|---|---|---|
| Ready-made child theme from the developer | Beginner | 2 min | Astra, GeneratePress, Hello Elementor and similar |
| Child theme generator | Beginner | 3 min | Any classic theme, plus Divi and block themes |
| Plugin (Child Theme Configurator) | Beginner | 5 min | Live sites where you also want settings copied |
| Manual creation | Intermediate | 10 min | Developers who want a clean, minimal setup |
If you are unsure, start with the manual method on a staging site. It takes ten minutes, teaches you how the pieces fit together, and avoids adding another plugin.
Method 1: create a child theme manually
This is the classic way, and it works for virtually any classic theme.
Step 1: Create the child theme folder
Connect by FTP or open your host’s file manager. Go to wp-content/themes/ and create a new folder. The convention is the parent’s folder name plus -child, for example astra-child. Avoid spaces and capital letters.
Step 2: Create style.css with the child theme header
Add a style.css file inside the new folder:
/*
Theme Name: Astra Child
Theme URI: https://example.com/astra-child/
Description: Child theme for Astra
Author: Your Name
Author URI: https://example.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
*/
/* Your custom CSS starts below this line */
Theme Name and Template are strictly needed. The rest is metadata. Template must equal the parent’s folder name, which is not always the same as its display name.Step 3: Create functions.php and enqueue the stylesheets
Next, add functions.php. This version loads the parent’s CSS first and your child CSS second, and it uses the version numbers so browsers refresh the cache after an update:
<?php
/**
* Astra Child theme functions.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
add_action( 'wp_enqueue_scripts', 'astra_child_enqueue_styles' );
function astra_child_enqueue_styles() {
$parent_handle = 'parent-style';
wp_enqueue_style(
$parent_handle,
get_template_directory_uri() . '/style.css',
array(),
wp_get_theme( get_template() )->get( 'Version' )
);
wp_enqueue_style(
'child-style',
get_stylesheet_uri(),
array( $parent_handle ),
wp_get_theme()->get( 'Version' )
);
}
Notice there is no closing ?> tag. Leaving it out is the WordPress coding standard for PHP-only files and prevents the “headers already sent” errors caused by stray whitespace.
functions.php and search for wp_enqueue_style to confirm.Step 4: Add a screenshot (optional)
Drop a screenshot.png (1200 × 900 px recommended) into the folder so you can recognize the theme in the dashboard.
Step 5: Activate the child theme
Open Appearance → Themes, find your child theme, click Live Preview to confirm everything looks right, then click Activate. If the site looks unstyled, the enqueue step is the usual cause; see troubleshooting.
Step 6: Test a change
Add a harmless rule to the bottom of your child style.css, such as a:hover { text-decoration: underline; }, reload the front end and confirm it applies. Now you know the setup works.
Method 2: create a child theme with a plugin
A plugin is the friendliest route if you would rather not touch FTP. The most widely used option is the free Child Theme Configurator. It creates the files, can detect the parent’s stylesheet dependencies and can copy existing widgets and Customizer options to the new theme. For a wider comparison, read our roundup of the best WordPress child theme plugins.
- Install and activate the plugin from Plugins → Add New.
- Go to Tools → Child Themes.
- Choose Create a new Child Theme, select the parent theme and click Analyze.
- Keep the default options if you are unsure and click Create New Child Theme.
- Preview, then activate it under Appearance → Themes.
Once the child theme exists you can deactivate and delete the plugin if you like. The child theme keeps working on its own, which keeps your site lean.
Method 3: free child theme generator for WordPress
Want the speed of a plugin and the cleanliness of manual code? Use this free child theme generator. Fill in the fields, choose your theme type (classic, Divi or block) and it builds a ready style.css and functions.php (or theme.json for block themes). Everything runs in your browser; nothing is uploaded.
Create a folder named astra-child in wp-content/themes/, add the files, then activate it. Always test on staging first.
How to create a Divi child theme
Divi is one of the most popular themes that people customize, so “how to create a Divi child theme” is a very common question. The process is the same as above with two Divi-specific details: the parent folder is named Divi (capital D), and Divi registers its main stylesheet under the handle divi-style.
- Create a folder called
divi-childinwp-content/themes/. - Add a
style.csswithTemplate: Divi. - Add a
functions.phpthat enqueuesdivi-styleand then your child stylesheet. - Activate it under Appearance → Themes.
/*
Theme Name: Divi Child
Theme URI: https://www.elegantthemes.com/gallery/divi/
Description: Divi Child Theme
Author: Your Name
Template: Divi
Version: 1.0.0
*/
<?php
add_action( 'wp_enqueue_scripts', 'divi_child_enqueue_styles' );
function divi_child_enqueue_styles() {
wp_enqueue_style( 'divi-style', get_template_directory_uri() . '/style.css' );
wp_enqueue_style( 'divi-child-style', get_stylesheet_uri(), array( 'divi-style' ), wp_get_theme()->get( 'Version' ) );
}
You can skip the typing: pick Divi in the Divi child theme generator above and it fills in the right folder name and handle for you. Elegant Themes also documents the process in its help center article How to Create a Child Theme for Divi, which additionally shows the plugin route.
functions.php to confirm the stylesheet handle before you enqueue it.Child theme for block themes: creating a block child theme
Block themes (also called full site editing themes) work differently, and many tutorials still skip them. In a block theme, design lives mostly in theme.json, templates/ and parts/ instead of PHP template files. If you are new to the format, our explainer on the WordPress block theme covers the basics.
Do block themes still need a child theme?
Often less than classic themes. The Site Editor saves your changes in the database, so they survive updates. A block child theme still makes sense when you want your customizations in version control, need to ship the same design to several sites, or want to override templates and design tokens as code.
Create a block child theme step by step
- Create the folder, for example
twentytwentyfive-child. - Add
style.csswith the same header as before and the correctTemplate:value. - Add a
theme.jsoncontaining only the settings and styles you want to change. WordPress merges it with the parent’s file. - Copy any template or template part you want to replace into
templates/orparts/with the same file name. - Activate the child theme.
{
"$schema": "https://schemas.wp.org/trunk/theme.json",
"version": 3,
"settings": {
"color": {
"palette": [
{ "slug": "accent", "name": "Accent", "color": "#2563eb" }
]
}
},
"styles": {
"elements": {
"link": { "color": { "text": "var(--wp--preset--color--accent)" } }
}
}
}
Use "version": 3 on WordPress 6.6 or later and 2 on older releases. If you put CSS in the child’s style.css, remember that block themes do not always load it automatically, so enqueue it from functions.php or move those rules into theme.json.
Hello Elementor and other ready-made child themes
Before you build anything, check whether your theme already offers a child theme. Elementor publishes one for its Hello theme on GitHub, and most popular multipurpose themes provide a download in their documentation. It saves time and avoids enqueue mistakes. If you are comparing builder-friendly themes, see our picks of WordPress Elementor themes.
How to install and activate a child theme
If you created the folder directly on the server, simply activate it. If you built it locally or downloaded it as a ZIP:
- Compress the child theme folder (not just its contents) into a ZIP file.
- Go to Appearance → Themes → Add New → Upload Theme.
- Upload the ZIP and click Install Now. WordPress checks that the parent theme exists.
- Click Activate. The parent stays installed but inactive.
For a screenshot-style walkthrough of the upload screen, see our guide on how to install a WordPress theme. And if you ever want to move away from it, changing your WordPress theme safely follows the same route in reverse: activate another theme from Appearance → Themes.
How to customize a child theme
Now the fun part. Technically you are not customizing the child theme; you are using it to customize the parent. Here are the four most common jobs.
1. Add custom CSS
Write your rules below the header in the child’s style.css. Because it loads after the parent’s CSS, rules with equal specificity win.
2. Override a template file
Copy the file from the parent into the child, keeping the same path, then edit the copy. For example, copy parent/single.php to child/single.php. Never copy files you do not intend to change; every override is something you must re-check after parent updates.
3. Add or change functions
Put hooks and filters in the child’s functions.php. It runs before the parent’s, so wrap parent functions you want to replace in function_exists() checks only if the parent supports pluggable functions; otherwise use hooks with a later priority or remove the parent’s callback and add your own.
add_action( 'after_setup_theme', 'my_child_setup' );
function my_child_setup() {
// Make strings translatable from the child theme.
load_child_theme_textdomain( 'my-child', get_stylesheet_directory() . '/languages' );
}
4. Create new templates and custom queries
Need a custom archive or a special “featured posts” section? Add a new template file and build the loop with WP_Query. Our free WordPress query generator writes the arguments for you, so you can paste a tested query straight into your child theme.
Running a shop? WooCommerce lets you copy its templates into a woocommerce/ folder inside the child theme to change the cart, checkout and product layouts. Pair that with the right hooks from our WooCommerce hooks list with examples, and always keep custom code compatible with your theme’s coding conventions (we outline them in WordPress theme standards).
Multilingual, RTL and GDPR tips for global sites
A child theme is also the right place for regional adjustments, which matters if your audience is in Germany, Austria, Switzerland, France, the UAE or Argentina.
- Translations. Give the child theme a unique text domain and load it with
load_child_theme_textdomain(). Store.poand.mofiles in alanguagesfolder for German (de_DE, de_AT, de_CH), French (fr_FR), Spanish for Argentina (es_AR) and Arabic (ar). If you run several languages, start from one of the multilingual WordPress themes we recommend. - Right-to-left support. Arabic sites need an
rtl.cssfile. WordPress loads it automatically when the site language is RTL, so keep your child theme’s directional rules (margins, floats, text alignment) there. Our list of RTL WordPress themes is a good starting point. - Privacy and fonts. European visitors expect GDPR-friendly sites. Hosting web fonts locally from the child theme, instead of calling a third-party CDN, avoids sending visitors’ IP addresses to outside servers, and German courts have already treated remote font loading as a privacy issue.
- Server location. Choose a data center close to your audience, such as Frankfurt, Zurich, Paris or Dubai, to reduce load time.
- Search visibility. If you publish translated pages, tell search engines about the language versions with
hreflangtags, following Google’s guidance on localized versions.
Updating the parent theme safely
This is where a child theme pays for itself. Update the parent as usual, then check the three things that can still break:
- Overridden templates. If the parent changed a file you copied, your version will not receive those fixes. Compare the files and merge the differences.
- Enqueue handles. A parent that renames its stylesheet handle can break your dependency array.
- WooCommerce templates. The WooCommerce status screen flags outdated overrides.
Always take a backup and test updates on staging. Our step-by-step article on how to upgrade a WordPress theme covers the full routine.
Troubleshooting common child theme problems
| Symptom | Likely cause | Fix |
|---|---|---|
| “The parent theme is missing” | Template: does not match the parent folder name |
Copy the exact folder name, including capital letters |
| Site looks unstyled | Parent stylesheet is not enqueued | Add or fix the enqueue code in functions.php |
| CSS changes do not appear | Cache, or the parent rule has higher specificity | Clear caches, check load order, use a more specific selector |
| White screen after activation | PHP syntax error | Rename the child folder via FTP to roll back, then fix the code. See common WordPress errors |
| Menus or widgets disappeared | Settings are stored per theme | Reassign them in Appearance, or copy them with a child theme plugin |
| Parent styles load twice | Parent already enqueues its CSS | Remove your duplicate parent enqueue |
Test safely on low-cost WordPress hosting
You do not need an expensive plan to work with child themes. A budget host with one-click staging, SSH or SFTP access and recent PHP versions is plenty. We compared the options in our guide to the best cheap WordPress hosting plans under $5 per month, and the official WordPress.org hosting requirements list the minimum PHP and MySQL or MariaDB versions to look for. Pick a data center near your visitors and you also get faster pages in Europe, the Gulf and Latin America.
Frequently asked questions
How do I create a child theme in WordPress without a plugin?
Create a folder in wp-content/themes/, add a style.css with a Template: line pointing to the parent folder, add a functions.php that enqueues the stylesheets, and activate it from Appearance → Themes.
Is there a free child theme generator for WordPress?
Yes. The generator in this article builds the files in your browser for classic, Divi and block themes. The free Child Theme Configurator plugin is another option.
What is the best method for creating a WordPress child theme?
For beginners, a generator or plugin. For developers, manual creation, because it adds no extra dependencies. If your theme author supplies a child theme, use that first.
Can I create a Divi child theme?
Yes. Use Template: Divi and enqueue the divi-style handle. The generator above has a Divi preset.
Do block themes need a child theme?
Not always, because Site Editor changes are saved in the database. Use a block child theme when you want your changes in code, in version control, or reusable across sites.
Will I lose my settings when I switch to a child theme?
Possibly. Customizer settings, menus locations and widgets are stored per theme. Test on staging and reassign or copy them as needed.
Can a child theme have its own child theme?
No. WordPress supports only one level: a child of a parent. Grandchild themes are not supported.
Does a child theme slow down my site?
Not noticeably. It adds one small stylesheet request. You can reduce it further by keeping custom CSS minimal and combining it with your caching setup.
How do I delete a child theme?
Activate the parent or another theme first, then delete the child theme from Appearance → Themes. Your child customizations will no longer apply.
Final thoughts
Learning how to create a child theme in WordPress is one of the best habits you can build. It protects your work, keeps updates painless and gives you a clean place to grow your customizations, whether you use a classic theme, Divi, Hello Elementor or a modern block theme. Start with the free generator, test on staging, and keep the parent theme updated.
Have a question about your own setup? Leave a comment and tell us which theme you are customizing.
