WordPress Child Theme Guide: Safe Customization

Published April 21, 2026

WordPress Child Theme Guide

A child theme inherits the functionality and styles of a parent theme but lets you customize safely. When the parent theme updates, your customizations survive in the child theme — no lost work. Every customization to a third-party theme should happen in a child theme.

Why Child Themes Are Essential

Theme updates often fix security vulnerabilities and bugs. If your customizations are in the parent theme files, you face a choice: skip updates (security risk) or update and lose your changes (lost work). Child themes eliminate this dilemma — update the parent freely while your child theme preserves all customizations.

Creating a Child Theme

Create a new directory in wp-content/themes/ named parent-theme-child/. Create two files:

style.css:

/*
Theme Name: Parent Theme Child
Template: parent-theme-slug
*/

functions.php:

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

Activate the child theme in Appearance → Themes. WordPress loads the parent theme's functionality first, then applies child theme overrides.

Overriding Templates

Copy any template file from the parent theme into your child theme preserving the same directory structure. WordPress checks the child theme first and uses your version if it exists. This lets you modify any template — header, footer, single post, archive — without touching parent files.

Adding Custom CSS

Add custom CSS to your child theme's style.css after the header comment. This CSS loads after the parent's stylesheet and overrides parent styles. For large amounts of CSS, create a custom.css file and enqueue it separately from functions.php to keep style.css clean.

Using functions.php

The child theme's functions.php loads before the parent's. Add custom functions, deregister parent functionality, change theme settings, and register new features here. Unlike templates (where the child version replaces the parent), both functions.php files load — parent and child together.

Child Themes for Block Themes

Block themes (FSE) handle child themes differently. Instead of PHP templates, they use block templates and theme.json. A child block theme overrides the parent's theme.json for global styles and adds or replaces template files. The structure is simpler but requires understanding the block template system.