A WordPress child theme gives you a separate place to customize a theme without editing its original files. That separation matters because an update to the parent theme can replace changes made directly to its files. With a child theme, you can adjust styles and add selected functions while keeping the parent theme available for updates.
Setting one up is usually straightforward, but small mistakes can prevent it from appearing in WordPress or cause the site to display incorrectly. This guide explains when a child theme is useful, how to create and activate one, and what to check before making changes on a live site.
What a WordPress child theme does
A child theme inherits its appearance and much of its functionality from a parent theme. The parent theme remains installed, while the child theme contains your customizations. WordPress uses the child theme’s files when they are available and relies on the parent theme for files the child does not provide.
Think of the child theme as a small set of overrides, not a complete copy of the parent. For example, you might place custom CSS in the child theme’s stylesheet. You can also add or modify certain PHP functions. The parent theme continues to supply the rest of the design and code.
This approach is useful when you want to:
- Make CSS changes that should remain after parent theme updates.
- Add a small, theme-specific function or adjust how a feature works.
- Keep customizations organized separately from the original theme files.
A child theme is not necessary for every site. If you only need a few visual adjustments, the WordPress Customizer, Site Editor, or a dedicated custom CSS feature may be enough. For changes that require editing theme files, a child theme is generally safer than modifying the parent directly. It also does not replace a backup or a testing environment.
Prepare before creating the child theme
First, identify the parent theme and confirm its exact folder name. You can usually find it under Appearance > Themes in WordPress. The folder name may not match the theme’s display name, so check the site’s files through your hosting file manager or SFTP if you are unsure. The parent theme must remain installed for the child theme to work.
Before changing files, make a current backup and, if possible, test the setup on a staging site. A child theme protects custom files from parent theme updates, but a typo or incompatible change can still break a page. A staging site gives you a place to catch problems before visitors see them. For broader testing, see this guide to debugging CSS layout issues.
You will need access to the site’s theme directory, typically located at wp-content/themes. Use your host’s file manager or an SFTP client. Avoid editing files through a browser-based editor unless you have another way to recover the site if a mistake causes an error.
Create the child theme files
Create a new folder inside wp-content/themes. Choose a simple folder name that identifies your child theme, such as parentname-child. Use lowercase letters and hyphens, and avoid spaces. This folder name is for the file system; it does not have to be the name displayed in the WordPress dashboard.
Inside the new folder, create a file named style.css. At the top of the file, add a theme header with the child theme’s name and the parent theme’s folder name. For example, the header can include a Theme Name value such as “Example Child” and a Template value containing the parent folder name, such as “example-theme.” The Template value must match the parent folder exactly, including spelling and capitalization.
You can also include optional details such as a description, author, and version. The essential parts are the theme name and the Template field. Without a valid Template value, WordPress may not recognize which parent theme the child should inherit from.
Next, decide how the parent stylesheet will be loaded. Many current themes already enqueue their styles correctly, and some block themes use a different approach to styling. Check the parent theme’s documentation before adding code. For a classic theme that requires it, create a file named functions.php in the child folder and use the parent theme’s recommended method to enqueue its stylesheet. Do not copy the parent’s entire functions.php file into the child theme. That can duplicate code and create errors.
If the parent theme’s documentation provides a specific enqueue snippet, use that rather than relying on a generic example. Theme behavior varies, and the wrong loading method can result in missing styles or styles loaded in the wrong order. Keep any child theme PHP code short and make one change at a time.
Activate and test the WordPress child theme
Once the files are in place, sign in to WordPress and open Appearance > Themes. The child theme should appear in the list. Preview it first if the option is available, then activate it when the preview looks correct.
After activation, inspect more than the homepage. Check a few pages and posts, menus, headers, footers, mobile layouts, and any templates your site depends on. Look for missing styles, unusual spacing, broken navigation, and error messages. If you use a staging site, compare the pages before and after activation.
If the child theme does not appear, check these items:
- Confirm that style.css is directly inside the child theme folder.
- Make sure the theme header is at the top of style.css and uses valid formatting.
- Check that the Template value matches the parent theme folder name exactly.
- Verify that the parent theme is installed and has not been moved or renamed.
If the theme appears but the page loses its styling, review the parent theme’s instructions for loading styles. Also clear any site or browser cache after confirming the files are correct. If a PHP change produces a blank page or error, use your hosting file manager or SFTP to remove or correct the new code, then test again on staging.
Make changes without creating update problems
Put your custom CSS in the child theme’s stylesheet, and keep a note of what each change is meant to do. Use clear selectors and avoid copying large sections of the parent stylesheet unless there is a specific reason. A broad rule can unintentionally affect buttons, forms, or layouts across the entire site.
Use the child theme’s functions.php only for code that genuinely belongs to the theme. Keep unrelated features, such as analytics or form integrations, in suitable plugins when possible. Theme-specific behavior can make sense in the child theme, but features you want to keep if you switch themes should not depend on it.
Parent theme updates can still change the markup or behavior your customizations rely on. After a significant update, check the pages affected by your CSS or functions. If something no longer works, compare the parent theme’s updated files and documentation rather than overwriting the parent with an old copy.
A well-maintained child theme stays small: it holds only the changes the parent does not provide. Keep a backup, test changes before publishing, and record any custom code so another site administrator can understand it. That approach makes theme customization easier to maintain without turning routine parent theme updates into a reason to rebuild the site.
