There is a moment of dread that almost every WordPress site owner knows. A theme update notification appears – you know you should install it for security reasons, but a cold sweat sets in. You click „Update”, and moments later all your carefully made changes to the look and features… are gone. For good.
It is a trap many fall into. In one project, to fix a confusing navigation, I added a custom snippet directly to the client’s theme files. The fix worked perfectly – but leaving it there is like a sandcastle: beautiful, until the first tide. That tide would be the next update. My job was not only to fix the problem, but to do it professionally – in a way that protects the work for the future.
The problem: why do changes disappear?
Imagine your theme as a house from a catalogue. An update is not repainting the walls – it is demolishing the old house and putting up a new, improved version from the same series. All your individual tweaks get levelled to the ground. That is why we never modify the original theme files directly.
The solution: a safe „extension” (Child Theme)
The gold standard in the WordPress world is a child theme. In our metaphor – an extension to the existing house. All modifications, features and styles go into that separate space. When the main building undergoes a renovation (an update), the extension stays untouched and still fits perfectly. Simple, elegant and effective.
Workshop: a Child Theme in 4 steps
Creating a child theme is easier than it seems. Here is a guide for the popular Astra theme (the process is analogous for other themes).
Step 1: create the child theme folder. Connect to your server via FTP (e.g. FileZilla), go to wp-content/themes/ and create a folder called astra-child.
Step 2: create style.css – the heart of the extension. Inside astra-child, create style.css and paste the header. The key line is Template: astra – it must exactly match the parent theme’s folder name.
/*
Theme Name: Astra Child
Template: astra
Version: 1.0.0
*/
Step 3: create functions.php and link the two themes. In the same folder create functions.php and paste the code below – it loads the Astra styles so your site looks right.
<?php
function astra_child_enqueue_parent_styles() {
wp_enqueue_style( 'astra-parent-style', get_template_directory_uri() . '/style.css' );
}
add_action( 'wp_enqueue_scripts', 'astra_child_enqueue_parent_styles' );
// From here you safely add your own code
Step 4: activate and enjoy the peace of mind. Go to Appearance → Themes, find your new „Astra Child” and activate it. From now on you add PHP code to functions.php and styles to style.css in the child folder. They will be safe forever.
Thanks to this simple move, the client can now click „Update” without fear, knowing her key features are safe. True professionalism is not only solving a problem, but anticipating the next ones – thinking about solutions that work not just today, but a year from now too.



