{"id":1204,"date":"2023-10-14T13:47:07","date_gmt":"2023-10-14T13:47:07","guid":{"rendered":"https:\/\/wpconsults.com\/?p=1204"},"modified":"2026-07-04T23:04:30","modified_gmt":"2026-07-04T23:04:30","slug":"comment-creer-un-theme-enfant-wordpress-2","status":"publish","type":"post","link":"https:\/\/www.wpconsults.com\/fr\/how-create-wordpress-child-theme\/","title":{"rendered":"How to Create a WordPress Child Theme (Manually or With a Plugin)"},"content":{"rendered":"<p class=\"wp-block-paragraph\">A <strong>WordPress child theme<\/strong> lets you customize your site while keeping every change safe when the parent theme updates. Without one, an update can silently wipe your edits, and I have seen that happen to more sites than I can count.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Here is how to create one, first manually with two small files, then with a plugin if you would rather not touch code. I will also tell you when you do not need a child theme at all, because sometimes you genuinely do not.<\/p>\n\n\n\n<div class=\"wp-block-group wpc-takeaways is-layout-flow wp-block-group-is-layout-flow\">\n<h2 class=\"wp-block-heading toc-ignore\">Principaux enseignements<\/h2>\n<ul class=\"wp-block-list\">\n<li>A child theme inherits everything from its parent and overrides only what you change, so parent updates never touch your customizations.<\/li>\n<li>The manual method needs just a folder and a <strong>style.css<\/strong> file; add functions.php only when you want custom PHP.<\/li>\n<li>Le <strong>Template<\/strong> line in style.css must match the parent theme&#8217;s folder name exactly, or the child will not work.<\/li>\n<li>Child Theme Configurator does the same job without code and can copy your Customizer settings across.<\/li>\n<li>For CSS-only tweaks or block themes edited in the Site Editor, you may not need a child theme at all.<\/li>\n<\/ul>\n<\/div>\n\n\n<style>.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-content-wrap{padding-top:var(--global-kb-spacing-sm, 1.5rem);padding-right:var(--global-kb-spacing-sm, 1.5rem);padding-bottom:var(--global-kb-spacing-sm, 1.5rem);padding-left:var(--global-kb-spacing-sm, 1.5rem);border-top:1px solid var(--global-palette10, #3182CE);border-right:1px solid var(--global-palette10, #3182CE);border-bottom:1px solid var(--global-palette10, #3182CE);border-left:1px solid var(--global-palette10, #3182CE);border-top-left-radius:5px;border-top-right-radius:5px;border-bottom-right-radius:5px;border-bottom-left-radius:5px;box-shadow:15px 15px 0px 0px rgba(160, 152, 255, 0.31);}.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-contents-title-wrap{padding-top:0px;padding-right:0px;padding-bottom:0px;padding-left:0px;}.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-contents-title{font-weight:regular;font-style:normal;}.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-content-wrap .kb-table-of-content-list{color:var(--global-palette1, #3182CE);font-weight:regular;font-style:normal;margin-top:var(--global-kb-spacing-sm, 1.5rem);margin-right:0px;margin-bottom:0px;margin-left:0px;}@media all and (max-width: 1024px){.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-content-wrap{border-top:1px solid var(--global-palette10, #3182CE);border-right:1px solid var(--global-palette10, #3182CE);border-bottom:1px solid var(--global-palette10, #3182CE);border-left:1px solid var(--global-palette10, #3182CE);}}@media all and (max-width: 767px){.kb-table-of-content-nav.kb-table-of-content-id7066_f7400a-9c .kb-table-of-content-wrap{border-top:1px solid var(--global-palette10, #3182CE);border-right:1px solid var(--global-palette10, #3182CE);border-bottom:1px solid var(--global-palette10, #3182CE);border-left:1px solid var(--global-palette10, #3182CE);}}<\/style>\n\n<h2 class=\"wp-block-heading\">What a WordPress child theme is, and why it protects your edits<\/h2>\n\n\n<p class=\"wp-block-paragraph\">A child theme is a theme that inherits the design and functionality of another theme, the parent. WordPress loads the child&#8217;s files first and falls back to the parent for everything else, so you override only the pieces you customize while the parent keeps doing the heavy lifting.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The payoff comes at update time. Edit the parent theme directly and the next update overwrites your work; put the same edits in a child theme and the parent updates cleanly underneath them. The <a href=\"https:\/\/developer.wordpress.org\/themes\/advanced-topics\/child-themes\/\" target=\"_blank\" rel=\"noopener nofollow\">WordPress developer handbook<\/a> recommends exactly this approach for modifying any theme you did not build yourself.<\/p>\n\n\n<h2 class=\"wp-block-heading\">When you do not need a child theme<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Honest scoping first, because a child theme is not automatic best practice for everyone. If all you want is a few CSS tweaks, the <strong>Additional CSS<\/strong> box in the Customizer survives updates on its own. Small PHP snippets can live in a code snippets plugin, and block themes edited through the Site Editor store those changes in the database, not in theme files, so updates do not erase them.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Where a child theme earns its keep is template overrides, custom functions you want versioned with the theme, and any project where the customization is more than cosmetic. If that is you, read on.<\/p>\n\n\n<h2 class=\"wp-block-heading\">Method 1: Create a WordPress child theme manually<\/h2>\n\n\n<p class=\"wp-block-paragraph\">You need access to your site&#8217;s files (hosting file manager, FTP, or SFTP) and about five minutes. The structure you are building looks like this:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1100\" height=\"733\" src=\"https:\/\/www.wpconsults.com\/wp-content\/uploads\/2026\/07\/wordpress-child-theme-folder-structure-mockup-7542.avif\" alt=\"WordPress child theme folder with style.css and functions.php files\" class=\"wp-image-7542\" srcset=\"https:\/\/www.wpconsults.com\/wp-content\/uploads\/2026\/07\/wordpress-child-theme-folder-structure-mockup-7542.avif 1100w, https:\/\/www.wpconsults.com\/wp-content\/uploads\/2026\/07\/wordpress-child-theme-folder-structure-mockup-7542-300x200.avif 300w, https:\/\/www.wpconsults.com\/wp-content\/uploads\/2026\/07\/wordpress-child-theme-folder-structure-mockup-7542-1024x682.avif 1024w, https:\/\/www.wpconsults.com\/wp-content\/uploads\/2026\/07\/wordpress-child-theme-folder-structure-mockup-7542-768x512.avif 768w, https:\/\/www.wpconsults.com\/wp-content\/uploads\/2026\/07\/wordpress-child-theme-folder-structure-mockup-7542-18x12.avif 18w\" sizes=\"auto, (max-width: 1100px) 100vw, 1100px\" \/><figcaption class=\"wp-element-caption\">The whole child theme: one folder inside wp-content\/themes holding style.css, plus functions.php when you need custom PHP.<\/figcaption><\/figure>\n\n\n\n<ol class=\"wp-block-list\">\n<li><strong>Create a folder<\/strong> inside <code>wp-content\/themes\/<\/code>. Name it after the parent, like <code>kadence-child<\/code>, so future-you knows what it belongs to.<\/li>\n<li><strong>Create style.css<\/strong> inside that folder with this header:<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>\/*\nTheme Name: My Child Theme\nTemplate: parent-theme\n*\/<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Two lines matter here. <strong>Theme Name<\/strong> is whatever you want shown in the admin, but <strong>Template<\/strong> must match the parent theme&#8217;s folder name exactly, lowercase and all. If the parent lives in <code>wp-content\/themes\/kadence<\/code>, the line is <code>Template: kadence<\/code>; get this wrong and WordPress reports a broken theme.<\/p>\n\n\n\n<ol class=\"wp-block-list\" start=\"3\">\n<li><strong>Create functions.php<\/strong> in the same folder if the parent&#8217;s styles do not load on their own (many classic themes need this):<\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nadd_action( 'wp_enqueue_scripts', 'my_child_theme_enqueue_styles' );\n\nfunction my_child_theme_enqueue_styles() {\n    wp_enqueue_style( 'parent-style', get_template_directory_uri() . '\/style.css' );\n    wp_enqueue_style( 'child-style', get_stylesheet_uri(), array( 'parent-style' ) );\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">This loads the parent stylesheet first, then your child stylesheet on top of it, so your CSS wins any conflict. One caution: some themes already enqueue their own styles a different way, so check the parent&#8217;s documentation; well-known themes like Kadence, Astra, and GeneratePress even offer ready-made child themes you can download instead of building one.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Only style.css is required.<\/strong> If you have no PHP to add, skip functions.php entirely; the child theme works with the stylesheet alone.<\/p>\n\n\n<h3 class=\"wp-block-heading\">Activate the child theme<\/h3>\n\n\n<p class=\"wp-block-paragraph\">Aller \u00e0 <strong>Appearance &gt; Themes<\/strong> in your dashboard, find your new child theme, and click Activate. One thing to expect: Customizer settings, menus, and widget placements are stored per theme, so switching to the child can reset them and you may need to reassign menus or re-enter Customizer options once.<\/p>\n\n\n<h2 class=\"wp-block-heading\">Method 2: Create a child theme with the Child Theme Configurator plugin<\/h2>\n\n\n<p class=\"wp-block-paragraph\">If editing files is not your thing, the free <a href=\"https:\/\/wordpress.org\/plugins\/child-theme-configurator\/\" target=\"_blank\" rel=\"noopener nofollow\">Configurateur de th\u00e8me enfant<\/a> plugin builds the same two files for you and adds one genuinely useful extra: it can copy the parent&#8217;s Customizer settings, menus, and widgets into the child, which sidesteps the reset problem from the manual method.<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Install and activate the plugin from <strong>Plugins &gt; Ajouter un nouveau<\/strong>.<\/li>\n<li>Ouvrir <strong>Tools &gt; Child Themes<\/strong>, select your parent theme, and click <strong>Analyze<\/strong>; the plugin checks how the parent loads its styles and picks the right enqueue method.<\/li>\n<li>Accept the defaults (or tick the option to copy parent settings), click <strong>Create New Child Theme<\/strong>, then preview and activate it from Appearance &gt; Themes.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">After activation you can add CSS through the plugin&#8217;s editor or the Customizer, and PHP through the child&#8217;s functions.php in the theme file editor (under Appearance on classic themes, Tools on block themes). That is the same place my <a href=\"https:\/\/www.wpconsults.com\/fr\/personnaliser-manuellement-la-page-de-connexion-de-wordpress-2\/\">login page customization snippets<\/a> go, which is exactly the kind of edit a child theme exists to protect.<\/p>\n\n\n<h2 class=\"wp-block-heading\">Child themes on block themes<\/h2>\n\n\n<p class=\"wp-block-paragraph\">Block themes (the ones edited through the Site Editor) support child themes too, with theme.json inheriting the same way templates do. In practice you need one less often, because Site Editor changes live in the database and survive updates, but a child theme still makes sense when you want file-based overrides you can version and deploy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Whichever route you take, remember the theme itself carries SEO weight through its speed and markup; I broke down where that genuinely matters in <a href=\"https:\/\/www.wpconsults.com\/fr\/votre-theme-wordpress-nuit-il-a-votre-referencement-2\/\">is your WordPress theme hurting your SEO<\/a>. A child theme changes none of that; it just makes your customizations survivable.<\/p>\n\n\n<h2 class=\"wp-block-heading\">So, should every WordPress site run a child theme?<\/h2>\n\n\n<p class=\"wp-block-paragraph\">If this were my site and I planned any file-level customization on a classic theme, I would create the child theme before writing a single line, because retrofitting one after an update has eaten your edits is miserable. The manual method is my default; it is two small files and you understand exactly what they do.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">But for a site that only needs a little Additional CSS, or a block theme edited entirely in the Site Editor, skipping the child theme is a legitimate choice rather than a mistake. Match the tool to the depth of the customization, not to a rule.<\/p>\n\n\n\n<div class=\"wp-block-group wpc-post-cta is-layout-flow wp-block-group-is-layout-flow\">\n<h3 class=\"wp-block-heading\">Need a hand customizing your theme safely?<\/h3>\n<p class=\"wp-block-paragraph\">If your child theme will not activate, or an update already wiped your customizations, <a href=\"https:\/\/www.wpconsults.com\/fr\/travailler-avec-wpconsults\/\">nous contacter<\/a> ou <a href=\"mailto:abdullah@wpconsults.com\">m'envoyer un courriel<\/a> and I will help you rebuild it the durable way. Ten minutes of setup now saves the whole redesign later.<\/p>\n<\/div>\n\n\n\n<div class=\"wp-block-group wpc-changelog is-layout-flow wp-block-group-is-layout-flow\" id=\"article-update-logs\">\n<h2 class=\"wp-block-heading\">Journal des mises \u00e0 jour<\/h2>\n<p class=\"wp-block-paragraph\"><strong>04 Jul 2026<\/strong><\/p>\n<ul class=\"wp-block-list\"><li>Refreshed both methods for current WordPress: a corrected enqueue snippet that loads the child stylesheet with the parent as a dependency, the Customizer-reset caveat when activating, block theme guidance, and an honest section on when you can skip a child theme entirely.<\/li><\/ul>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>A WordPress child theme keeps your custom CSS and code safe when the parent theme updates. Here is how to create one manually or with a plugin, and when you can skip it.<\/p>","protected":false},"author":1,"featured_media":7540,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_kb_optimizer_status":0,"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","rank_math_title":"WordPress Child Theme: Create One in 2 Easy Methods","rank_math_description":"Learn how to create a WordPress child theme manually or with a plugin, keep your customizations safe through theme updates, and know when you can skip one.","rank_math_focus_keyword":"WordPress child theme","_colophon_preset":"regular","_colophon_fc_on":"","_colophon_edited_on":"","footnotes":""},"categories":[7],"tags":[64],"class_list":["post-1204","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-wordpress-tips-tutorials","tag-without-plugin-series"],"_links":{"self":[{"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/posts\/1204","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/comments?post=1204"}],"version-history":[{"count":3,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/posts\/1204\/revisions"}],"predecessor-version":[{"id":7610,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/posts\/1204\/revisions\/7610"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/media\/7540"}],"wp:attachment":[{"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/media?parent=1204"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/categories?post=1204"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.wpconsults.com\/fr\/wp-json\/wp\/v2\/tags?post=1204"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}