A theme update shouldn’t erase hours of design work, custom CSS, or carefully added functions. Yet that can happen when changes are made directly to a parent theme. A WordPress child theme gives you a safer place to customize your site while keeping the original theme available for updates.

We use child themes for targeted changes, such as styling adjustments, custom functions, and modified templates. With the right setup, you can update the parent theme without starting over. Let’s begin with what a child theme protects and what it doesn’t.

Key Takeaways

  • A child theme stores your custom code separately from the parent theme.
  • The child theme needs a style.css file and a functions.php file.
  • The Template value must match the parent theme’s folder name exactly.
  • Existing Customizer settings, template edits, and custom code may need to be moved manually.
  • Backups, staging, and dependable WordPress hosting make theme updates safer.

Why a WordPress Child Theme Protects Your Changes

A parent theme is the main theme installed on your WordPress website. It contains the templates, styles, functions, images, and other files that control the site’s appearance and behavior.

A child theme depends on that parent theme. It can use the parent’s files while allowing you to add or override selected files in a separate folder. WordPress loads the child theme’s version when both themes contain the same template file.

Think of the parent theme as the original house plans. The child theme is your approved renovation file. You can repaint a room, change the layout of one area, or add new fixtures without writing over the architect’s original plans.

The biggest reason to create one is simple: parent theme updates can overwrite direct edits. If you edit the parent theme’s style.css, functions.php, or single.php, those changes may disappear when the theme developer releases a new version.

The WordPress Theme Handbook provides a useful explanation of how child themes work, including the files required and the way WordPress handles template overrides.

A developer working on a laptop displaying code in a dimly lit room.

A child theme protects code changes by keeping them outside the parent theme’s update path.

That protection has limits. A child theme won’t automatically preserve every setting made through the WordPress Customizer. It also won’t fix custom code that depends on a function the parent developer removes. The goal is not to make updates risk-free. The goal is to keep your work separate, organized, and easier to test.

Prepare Before Creating the Child Theme

Creating the files is quick. Moving existing customizations safely takes more care. Before you begin, find out what has already been changed on the website.

Make an inventory of current changes

Look through the parent theme folder and record anything that differs from the original theme. Common locations include:

  • style.css for custom styles
  • functions.php for PHP snippets and theme functions
  • Template files such as header.php, footer.php, page.php, and single.php
  • JavaScript files that were added or edited
  • Images, fonts, and other assets placed inside the theme folder

Don’t assume every change was made in the theme files. Custom CSS may be stored under Appearance > Customize > Additional CSS. Page builders may store layouts in the database. Plugins may contain snippets that affect the site’s design.

If you use an FTP client such as FileZilla, download a copy of the current theme folder before making changes. You can also compare your files with a fresh copy of the same parent theme version. That comparison helps separate your work from the original files.

Create a complete backup

Make a backup of both the WordPress files and the database. The database contains posts, pages, Customizer settings, menus, widgets, and many theme options. A copy of the theme folder alone isn’t enough.

Keep the backup somewhere separate from the hosting account. If a failed update affects your account, a second backup location gives you another way back in.

A plugin such as UpdraftPlus can handle scheduled backups, although your hosting provider may also include backup tools. Check how often backups run, where they are stored, and whether you can restore them before relying on them.

Use staging when available

A staging site is a private copy of your website where you can test the child theme and parent theme updates. It lets you find layout problems before visitors see them.

Test the main actions on your website, not only the homepage. Check contact forms, shopping cart pages, login screens, blog posts, mobile layouts, and any page built with a visual editor.

If your current hosting plan doesn’t provide staging, you can still create a backup and work during a low-traffic period. However, staging is the safer option for a business website. Reliable hosting, regular backups, security monitoring, and human support reduce the technical pressure around changes like this. ZADiC’s WordPress hosting and managed Web Hosting Plus options are built for site owners who want the infrastructure handled without giving up room to grow.

Create the Two Core Child Theme Files

A child theme normally needs two files:

  1. style.css
  2. functions.php

Both files belong in a new folder inside wp-content/themes/. The folder name can be different from the parent theme, but use lowercase letters and hyphens to keep it clear.

For example, if the parent theme folder is astra, you could name the child folder astra-child:

wp-content/themes/astra-child/

The folder name is not the same thing as the theme name shown in the WordPress dashboard. The folder name is used by WordPress internally, so keep it simple and avoid spaces.

Add the child theme stylesheet

Create a file named style.css inside the child theme folder. Add a theme header like this:

/* Theme Name: Astra Child Template: astra Version: 1.0.0 */

The required value is Template. It must match the parent theme’s directory name exactly, including capitalization where applicable.

If the parent theme is stored in a folder called generatepress, the header needs to use:

Template: generatepress

It must not use the display name, a download filename, or the theme’s website name. A wrong Template value prevents WordPress from identifying the parent theme correctly.

You can add your own CSS below the header. For example:

body { background-color: #f7f7f7; }

Keep the stylesheet focused on your changes. Don’t copy the entire parent style.css into the child theme. Duplicate files create more work during updates and make troubleshooting harder.

Load the parent stylesheet correctly

The child theme needs access to the parent theme’s styles. Modern WordPress practice is to load the parent stylesheet through functions.php, rather than using @import in style.css.

Create functions.php in the child theme folder and add:

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

The child theme’s functions.php is loaded alongside the parent’s file. It doesn’t replace the parent file. That means you should add your custom functions to the child file, not copy the parent’s functions into it.

Some themes use several stylesheets or a special method for loading styles. Always check the parent theme’s documentation if the basic approach doesn’t produce the expected result.

A person using a computer to view a website dashboard interface.

The child theme appears in the WordPress dashboard after its folder and stylesheet header are valid.

Install and Activate the Child Theme

Once the files are ready, upload the child theme folder to wp-content/themes/. You can use your hosting control panel’s file manager, SFTP, or FTP.

You can also compress the folder into a ZIP file. The ZIP should contain the child theme folder, with style.css and functions.php directly inside it. Avoid creating an extra folder level such as astra-child/astra-child/style.css.

In the WordPress dashboard, open Appearance > Themes. The child theme should appear beside the parent theme. Select Activate on the child theme.

The parent theme must be installed, but it doesn’t need to be active. WordPress uses the active child theme and its associated parent theme together.

After activation, view the site in a private browser window. Check the header, navigation, fonts, spacing, footer, blog posts, and responsive layout. Clear your caching plugin and browser cache if changes don’t appear immediately.

If the website shows a blank page or a PHP error, don’t keep refreshing the live site. Use your hosting file manager or SFTP to rename the child theme folder temporarily. WordPress will usually fall back to another installed theme, allowing you to correct the error.

A missing semicolon, an incorrectly named function, or a bad file path can break a PHP file. Make one change at a time, and keep a clean copy of the last working version.

Move Existing Customizations Into the Child Theme

Creating a blank child theme won’t bring old customizations with it. You need to move each type of change to the right location.

Transfer custom CSS

Copy CSS rules from the parent theme’s style.css into the child theme’s stylesheet. Move only rules you wrote or changed. Leave the parent theme’s original CSS in the parent theme.

If your CSS was added under Additional CSS, you can usually leave it there. Those settings are stored in the database rather than inside the parent theme files. Still, export or document them before changing themes.

Some Customizer settings are tied to the active theme. Colors, typography choices, header settings, widget placements, and layout options may not transfer from a parent theme to its child automatically. Review every setting after activation.

If the site has many Customizer changes, use a reputable Customizer export and import tool. Export the settings from the parent theme, activate the child theme, and import them if the tool supports that theme structure. Always test the result first.

Move functions and PHP snippets

Copy your custom PHP functions into the child theme’s functions.php. Do not copy the full parent file. The parent functions are already loaded.

Give custom functions unique names. A generic name such as custom_setup() could conflict with a function from the parent theme or a plugin. Prefixing the function helps, such as zadic_custom_setup().

Check every snippet before adding it. Some snippets depend on a theme function, template, or plugin that may have changed. Add one snippet at a time and test the site after each change.

For scripts, styles, and custom assets, use WordPress enqueue functions instead of hardcoding files into the header. If you need to replace a parent script, the process may involve wp_dequeue_script() followed by wp_enqueue_script() for your child version.

Copy only the templates you need

WordPress checks the child theme first for template files. If it finds single.php in the child theme, it uses that file instead of the parent version.

To customize a template, copy the original file from the parent theme into the matching location in the child theme. Then edit the child copy.

For a small change to blog posts, your structure may look like this:

astra-child/ style.css functions.php single.php

If you need a template inside a subfolder, preserve that folder structure. For example, a WooCommerce template override belongs in the appropriate WooCommerce path, not randomly in the child theme’s root folder.

Copying every parent template defeats the purpose of a child theme. It creates a large set of files that you must compare and maintain. Override only the files you actually need.

Before copying a template, check whether a hook or filter can achieve the same result. Hooks usually survive parent theme updates better than a full template copy because they keep your change separate from the theme’s layout code.

The WordPress child theme handbook also recommends using the child theme for modifications while allowing the parent theme to provide the rest of the site’s structure.

Check Your Theme Customizations After Activation

Activation is not the finish line. It’s the first proper test.

Open the site on a desktop browser and a mobile device. Compare important pages with screenshots or your backup site. Look for changes in:

  • Header height and navigation spacing
  • Font sizes, colors, and line breaks
  • Featured images and blog post layouts
  • Buttons, forms, and call-to-action sections
  • Sidebars, widgets, and footer columns
  • WooCommerce product, cart, and checkout pages
  • Page builder templates and reusable blocks

Use your browser’s developer tools to inspect a problem element. A parent stylesheet may load after the child stylesheet, which can make your rule appear ineffective. In that case, check the CSS loading order and selector specificity before adding !important.

Review the page source and browser console for missing files or JavaScript errors. A child theme can be active while still pointing to the wrong asset path.

Check the WordPress Site Health screen too. PHP warnings and plugin conflicts may not show on the homepage. If you run a business site, test the lead form and email notifications before declaring the migration complete.

You can follow a visual walkthrough with this child theme setup tutorial if you prefer to see the folder and dashboard steps on screen.

Update the Parent Theme Without Losing Work

Once your customizations live in the child theme, you can update the parent theme without overwriting those child files. That doesn’t mean you should update without testing.

Parent themes can change their markup, CSS class names, hooks, function names, or template structure. Your child theme may still load, but a copied template could become outdated.

Use this update routine:

  1. Back up the live website and database.
  2. Read the parent theme’s changelog.
  3. Update the parent theme on staging first.
  4. Test the pages and functions you customized.
  5. Compare the changed parent templates with your child copies.
  6. Fix compatibility issues on staging.
  7. Push the tested changes to the live site.
  8. Test the live site again.

A copied single.php file is the most common source of hidden maintenance work. If the parent developer adds a new accessibility attribute or changes a template function, your older child copy won’t receive it automatically.

Keep a record of every file you override and every snippet you add. A short document with the file name, purpose, and date can save hours later.

Version control is useful for sites with frequent changes. Git lets you compare revisions, identify the change that caused a problem, and restore an earlier version. If you don’t use Git, keep dated ZIP backups of the child theme.

A person working on a glowing laptop at a wooden desk at night with a cup of coffee.

A safe update process gives you time to test changes before customers encounter them.

A child theme protects your files, but it doesn’t protect an outdated override from future parent-theme changes. Review copied templates after every major update.

Common Child Theme Problems and Fixes

The child theme doesn’t appear

Check the folder location and stylesheet header. The folder must be inside wp-content/themes/, and style.css must contain a valid Theme Name value.

The parent styles are missing

Confirm that Template matches the parent folder name. Then check the enqueue function in functions.php. Clear caching after correcting the file.

Changes in style.css don’t show

Your CSS may be cached, loaded before the parent stylesheet, or overridden by a more specific selector. Clear caches and inspect the element in your browser.

The website shows a PHP error

Look at the latest change in functions.php. A syntax error often comes from a missing semicolon, bracket, or quotation mark. Remove the newest snippet through SFTP or your hosting file manager, then test again.

Customizer settings disappeared

Some theme settings belong to the parent theme’s database entry. They may need to be exported from the parent and imported into the child. Review Customizer settings manually if the export tool doesn’t support your theme.

A template override stops working

Compare the child copy with the latest parent version. Look for changed function names, hooks, HTML structure, and template parts. If the change is no longer needed, remove the override and let the child theme inherit the updated parent file.

When a Child Theme Isn’t the Best Choice

A child theme is a strong fit for focused changes. It may not be the right tool for a complete redesign.

If you replace most of the parent theme’s templates, create a different content structure, and maintain large amounts of custom code, a custom theme may be easier to manage. A large child theme can become a second theme with an older parent underneath it.

Block themes also need a slightly different approach. Site Editor changes saved to templates can remain in the database, while copied templates and template parts in a child theme give you file-based control. A theme.json file can manage styles and settings in a block-based child theme.

Choose the simplest setup that matches the work:

Project needPractical option
Small CSS adjustmentsAdditional CSS or a child stylesheet
Custom PHP snippetsChild theme functions.php or a site-specific plugin
One changed templateCopy that template into the child theme
Several major layout changesA custom theme or carefully planned child theme
Block theme style changesSite Editor settings or child theme theme.json
Features needed after a theme changeA plugin instead of theme code

Theme styling belongs in a child theme. Features that should remain when you switch themes usually belong in a plugin. For example, custom post types, business logic, and important shortcodes shouldn’t disappear because you changed the site’s design.

Give Your WordPress Site a Safer Foundation

Theme files are only one part of a dependable website. Your hosting affects how easy it is to back up, test, secure, and recover your site.

For a small business or growing project, look for WordPress hosting with one-click setup, SSL, security monitoring, reliable backups, and support from people who can help when something goes wrong. Shared hosting can work for smaller sites, while managed hosting or a VPS gives you more room as traffic and site complexity increase.

ZADiC provides cPanel and WordPress hosting, managed Web Hosting Plus, VPS options, domain registration, professional email, SSL certificates, and website security tools. The goal is straightforward: give you reliable infrastructure without forcing you to become a server administrator.

That matters when a theme update goes sideways. You need a clear backup process, a place to manage files, and support that doesn’t leave you searching through vague help articles. A good hosting setup lets you focus on your pages, customers, and sales while the technical foundation stays dependable.

Conclusion

A child theme keeps your custom CSS, PHP, and template changes separate from the parent theme. Build the folder correctly, match the Template value exactly, enqueue the parent stylesheet, and move existing changes carefully.

Back up the site before you begin. Test updates on staging when possible, review copied templates, and keep notes about every customization. With a WordPress child theme and dependable hosting behind it, updates become a controlled maintenance task instead of a reason to rebuild your website.

We use cookies so you can have a great experience on our website. View more
Cookies settings
Accept
Decline
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active

Who we are

Our website address is: https://zadic.net.

Comments

When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection. An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.

Media

If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.

Cookies

If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year. If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser. When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed. If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.

Embedded content from other websites

Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website. These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.

Who we share your data with

If you request a password reset, your IP address will be included in the reset email.

How long we retain your data

If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue. For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.

What rights you have over your data

If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.

Where your data is sent

Visitor comments may be checked through an automated spam detection service.
Save settings
Cookies settings