Disclosure: some links on this page are partner links. IsItDev may earn a commission if you buy or sign up through them, at no extra cost to you. It does not change what we recommend. Details.
You want custom code on a Divi 5 site that survives theme updates, but most child theme tutorials were written for Divi 4. This guide answers whether you need a Divi 5 child theme at all, shows a minimal one that matches how Divi 5.19.1 loads stylesheets, and walks through switching a live site to it without losing menus, widgets or custom CSS.
Quick answer: Only for PHP or changes to Divi’s template files. CSS, scripts and icon fonts have built-in places in Divi 5, and PHP can also live in a must-use plugin.
- Create a
divi-childfolder with astyle.csswhose header saysTemplate: Divi. - Leave out
@importand enqueue code. Divi 5 loads the child stylesheet itself. - Add
functions.phponly when you have PHP to run. - Zip and upload it, or create it over SSH or with WP-CLI.
- Activate it on staging first, then check menus, widgets and Additional CSS.
In this guide
- Do You Need a Child Theme With Divi 5?
- Before You Start
- Build a Minimal Divi 5 Child Theme
- How Divi 5 Loads Your Child Stylesheet
- Switch a Live Site to the Child Theme Safely
- Custom PHP in a Divi 5 Child Theme
- Custom Divi 5 Modules Belong in a Plugin
- Troubleshooting Divi 5 Child Theme Errors
- Frequently Asked Questions
- Next Steps

Do You Need a Child Theme With Divi 5?
A child theme is a small theme that inherits everything from a parent (here, Divi) and keeps your changes in its own folder, so Divi updates don’t overwrite them. Elegant Themes’ child theme help article (June 2024) and blog guide (September 2023) predate Divi 5, but their rule still holds: CSS-only changes don’t need one, edits to template files such as footer.php do. Divi 5 adds design variables, option group presets and an Icon Manager, so the list is shorter still:
| What you want to change | Child theme needed? | Where it goes in Divi 5 |
|---|---|---|
| A few site-wide CSS rules | No | Divi → Theme Options → General → Custom CSS |
| CSS for one page or Theme Builder template | No | Page Settings → Advanced → Custom CSS |
| Styles reused across modules | No | Element and option group presets, design variables |
| Analytics or other head/body scripts | No | Divi → Theme Options → Integration |
| A custom icon font | No | The Icon Manager (Divi 5.17.0 and later) |
| PHP: filters, actions, upload file types | Optional | Child theme functions.php, a must-use plugin or a snippets plugin |
| Large CSS files in Git, self-hosted fonts | Optional, but convenient | Child theme folder |
| Overriding a Divi template file | Yes | A copy of that file in the child theme |
| A custom Divi 5 module | No | A plugin (see below) |
The paths come from Elegant Themes’ articles on where to add custom CSS in Divi 5 and the Divi 5 Theme Options. The second notes that the Custom CSS field syncs with the Customizer’s Additional CSS, which matters when you switch themes.
Where This Site Keeps Its Custom PHP
isitdev.com runs the parent Divi theme with no child theme. Its custom PHP (404 handling, breadcrumbs, the author box, affiliate CTA boxes, SEO fixes, reader UX) lives in 16 must-use plugins in wp-content/mu-plugins/, so theme updates and theme switches never touch it.
WordPress loads must-use plugins automatically, and they can’t be deactivated from the dashboard, but they get no update notices and only files directly in the folder load. A sensible split: a child theme for code that only makes sense with Divi, a must-use plugin for features you’d keep after a redesign.
Before You Start
- Access: a WordPress administrator account plus SFTP, SSH or your host’s file manager. WP-CLI is optional.
- Divi installed in
wp-content/themes/Divi, with that exact folder name. New site? See how to download and install Divi 5, or see the Divi plans if you don’t have a licence. - Staging: building the child theme is harmless; activating it changes per-theme settings. Switch on a WordPress staging copy first.
- Backup: take a full database backup before you activate; the WP-CLI block below includes one.
- Time: about 15 minutes to build, plus time to check key pages after the switch.
Build a Minimal Divi 5 Child Theme
Step 1: Create the Folder and style.css
Create a folder named divi-child (lowercase, no spaces; it becomes the theme’s slug). Inside it, create style.css with this header:
divi-child/style.css
/*
Theme Name: Divi Child
Template: Divi
Version: 1.0.0
Description: Child theme for Divi 5
*/
/* Your custom CSS goes below this line. */
Theme Name is what Appearance → Themes shows. Template must match the parent’s folder name exactly, per the WordPress child theme handbook, and Elegant Themes notes it is case-sensitive: Divi, not divi. Raise Version whenever you change the CSS. An optional screenshot.png becomes the theme’s thumbnail; WordPress’s theme structure docs give its size as 1200×900 pixels.
Step 2: Add functions.php Only If You Need PHP
Older guides, Elegant Themes’ included, add a functions.php that enqueues Divi’s style.css and then the child’s. Divi 5.19.1 loads both itself, and the handbook says a child theme needs nothing extra when the parent loads both stylesheets. When you have PHP to add, start from this:
divi-child/functions.php (minimal)
<?php
/**
* Divi Child theme functions.
* Divi loads this theme's style.css itself, so no enqueue code is needed.
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
// Add your PHP below this line, inside hooks such as add_action().
Leave out a closing ?> tag; stray whitespace after it can break page output. WordPress loads the child’s functions.php immediately before Divi’s, so Divi’s functions don’t exist yet when it runs. Put your code inside hooks.
Step 3: Install the Child Theme
Option A: zip and upload. In a terminal on your computer, run this from the folder that contains divi-child:
zip -r divi-child.zip divi-child -x "*.DS_Store"
You get divi-child.zip with the folder at its top level. Upload it under Appearance → Themes → Add New Theme → Upload Theme and click Install Now, but don’t activate it on a live site yet. A missing-stylesheet message usually means an extra folder level in the zip (here’s how to fix the missing style.css error), and “The link you followed has expired” means your upload limits are too low.
Option B: create it over SSH. Run this on the server from the WordPress root (the folder with wp-config.php):
SSH: create the child theme on the server
mkdir -p wp-content/themes/divi-child
cat > wp-content/themes/divi-child/style.css <<'EOF'
/*
Theme Name: Divi Child
Template: Divi
Version: 1.0.0
Description: Child theme for Divi 5
*/
EOF
wp theme listThe list should show divi-child as inactive and Divi as active. After the switch, Divi shows as parent.
Option C: WP-CLI scaffold. The scaffold child-theme command (WP-CLI 2.9.0 on this site’s server has it) builds the folder from the WordPress root and prints a Success line with its path:
wp scaffold child-theme divi-child --parent_theme=Divi --theme_name="Divi Child"
Two caveats. WP-CLI doesn’t check that the parent exists, so --parent_theme=divi gives you an orphan on a case-sensitive server. And its functions.php template enqueues both stylesheets itself, which Divi already does; replace it with the minimal file from Step 2. Leave --activate off on a live site.
How Divi 5 Loads Your Child Stylesheet
This is what the old guides miss. Divi 5.19.1’s own theme files, read on this site, show four things:
et_divi_enqueue_stylesheet()infunctions.phpenqueues Divi’sstyle.css(handledivi-style-parentwhen a child theme is active).- If the child theme hasn’t enqueued its own
style.css, Divi does it (handledivi-style-child). et_divi_replace_parent_stylesheet()swaps Divi’sstyle.cssfor a built file (minified, static, custom post type or RTL variant) depending on Dynamic CSS and other settings.et_requeue_child_theme_styles()incore/functions.phpmoves the child theme’s CSS after Divi’s stylesheet and dynamic CSS, using the child theme’s own Version number.
So a Divi child theme needs no stylesheet code, and @import is wrong: a comment in Divi’s code says importing Divi’s style.css from a child stylesheet “won’t work”. If an old child theme’s style.css imports Divi’s, delete that line.
Because your CSS loads last, your rule wins when selectors are equally specific; if it still loses, inspect the element and match Divi’s selector. The Version: header becomes the ?ver= value on your stylesheet URL, so raising it (1.0.0 to 1.0.1) makes browsers fetch the new file. To confirm it loads, search a page’s source for divi-child/style.css.
Switch a Live Site to the Child Theme Safely
What Stays the Same
- Divi Theme Options. Divi 5.19.1’s
functions.phpsets$shortname = 'divi';and Divi builds the option name from it, so Theme Options live in theet_divioption whichever theme folder is active. - Pages, posts and Theme Builder layouts. Divi 5 stores layouts as WordPress block markup in the database. On this site, the read-only audit query from the Divi 4 to Divi 5 upgrade guide counts Theme Builder header, footer and body layouts as rows in the posts table, not theme files.
- Presets, most likely. Elegant Themes doesn’t document where Divi 5 stores them, but its 5.14.0 changelog fixes global presets that failed to save under a child theme of a renamed Divi parent, so they’re expected to work. Export them anyway.
What WordPress Stores Per Theme
WordPress keeps some settings in an option named theme_mods_ plus the theme folder. On this site, theme_mods_Divi holds nav_menu_locations (primary, secondary and footer menus), sidebars_widgets (7 widget areas) and custom_css_post_id (the Customizer’s Additional CSS). A new child theme starts with an empty theme_mods_divi-child.
WordPress tries to carry things across. It maps menu locations with matching slugs through wp_map_nav_menu_locations() and widget areas with matching IDs through wp_map_sidebars_widgets(), sending unplaced widgets to Inactive Widgets. Divi’s code registers those locations and still runs under a child theme, so the names should match. Additional CSS doesn’t carry over: wp_get_custom_css_post() looks it up per theme.
On this site, the Additional CSS and Theme Options Custom CSS hold identical text (187 characters), and theme_mods_Divi contains et_pb_css_synced = yes: Divi keeps them in sync. What that sync does after a switch isn’t documented, so check your custom CSS still applies. Divi 5.8.0 also fixed Customizer background settings resetting when a child theme is activated.
The Switch, Step by Step
On staging, run these over SSH from the WordPress root. They save a database backup and the relevant options to your home directory, which on most hosts sits outside the public web folder:
WP-CLI: back up before switching themes
mkdir -p ~/divi-child-backup
wp option get stylesheet
wp db export ~/divi-child-backup/before-child-theme.sql
wp option get theme_mods_Divi --format=json > ~/divi-child-backup/theme_mods_Divi.json
wp option get et_divi --format=json > ~/divi-child-backup/et_divi.jsonThe second line should print Divi; if it prints another folder name, use it in the theme_mods_ line. The export prints a Success line, and both JSON files should contain data. Then:
- Export presets from the Preset Manager and variables from the Variable Manager, using the import/export icon in each (see Elegant Themes’ Preset Manager article).
- Export all Theme Builder templates with the Theme Builder’s portability (import/export) option.
- Activate the child theme under Appearance → Themes, or run
wp theme activate divi-child, which reports that it switched to Divi Child. - Run
wp option get stylesheetagain: it should printdivi-child. - Click Clear CSS Cache at the top right of Divi → Theme Options, then purge page cache and CDN.
- Work through the checklist, then repeat on the live site at a quiet time.
After switching to the child theme: checklist
- Header, footer and body templates display on the home page, a post and a page
- Each menu location has its menu (Appearance → Menus, Manage Locations)
- Widgets in every area; nothing in Inactive Widgets
- Theme Options Custom CSS and Additional CSS both present and applying
- Background colour and image unchanged
- Presets apply, and a test preset edit saves
- Integration code (analytics, verification tags) in the page source
- divi-child/style.css in the page source with the current version
Reassign anything missing using the backup JSON. To undo the switch, activate Divi again; theme_mods_Divi stays in the database.
Custom PHP in a Divi 5 Child Theme
Allow WOFF and WOFF2 Uploads
WordPress blocks WOFF, WOFF2 and SVG uploads by default. Elegant Themes’ article on enabling WOFF, WOFF2 and SVG uploads gives this snippet, added through the Code Snippets plugin. In a child theme, paste it at the end of functions.php:
Elegant Themes’ snippet: allow SVG, WOFF and WOFF2 uploads
function custom_mime_types($mimes) {
// Add new MIME types
$mimes['svg'] = 'image/svg+xml';
$mimes['woff'] = 'font/woff';
$mimes['woff2'] = 'font/woff2';
return $mimes;
}
add_filter('upload_mimes', 'custom_mime_types');The same article warns that SVG files can contain JavaScript (delete the svg line if you only need fonts) and says to disable the code once your fonts are uploaded. It also says the snippet only gets files into the Media Library: custom WOFF and WOFF2 fonts still won’t work in Divi’s own font upload. To use them, declare them yourself.
Self-Host WOFF2 Fonts From the Child Theme
A child theme can hold the font files, so you don’t need the upload snippet. Copy them to divi-child/fonts/ over SFTP, then add this to the child’s style.css with your own names:
divi-child/style.css: self-hosted font
@font-face {
font-family: "Brand Sans";
src: url("fonts/brand-sans.woff2") format("woff2"),
url("fonts/brand-sans.woff") format("woff");
font-weight: 400;
font-style: normal;
font-display: swap;
}
body {
font-family: "Brand Sans", Arial, sans-serif;
}Relative URLs resolve from the stylesheet’s location, so fonts/ points inside the child theme. Font settings in Divi presets and modules can override a plain body rule; target specific elements if they do. In your browser’s Network tab, the WOFF2 file should load with status 200.
Custom Icon Fonts
Usually no code is needed. Divi 5.17.0 (22 October 2026) added the Icon Manager, opened from a button at the bottom of any icon picker. Its help article says it imports a WOFF2, WOFF, TTF or OTF icon font, or SVG icons, without an upload plugin.
For developers, the Divi 5 changelog for 5.13 (11 September 2026) added APIs that let plugins and child themes register custom icon fonts. Elegant Themes’ PHP filter reference documents the server side: divi_icon_library_font_icon_types adds your icon type, divi_icon_library_font_icon_families maps it to a CSS font-family (you enqueue the @font-face CSS yourself), and divi_icon_library_font_icon_list takes your glyphs. It gives no complete example and refers to matching JavaScript icon lists, so treat this as plugin-developer work.
Override a Divi Template File
Copy the file (say footer.php) from wp-content/themes/Divi/ to the same path in divi-child/ and edit the copy; WordPress uses the child’s version. Your copy won’t receive Divi’s later changes to that file, so keep overrides few and try a Theme Builder template first.
Custom Divi 5 Modules Belong in a Plugin
Elegant Themes’ older help articles show how to move Divi 4 modules, such as the Blog module, into a child theme. Divi 5 modules are built differently. The official D5 extension example modules keep Visual Builder components in src/components and front-end rendering in modules, need Node.js and Composer, and install as a plugin; the 5.12.0 changelog moved them to scoped @divi/* npm packages. The Create Divi 5 Module in 10 Minutes tutorial also starts with a folder in wp-content/plugins.
Neither mentions child themes, but every official example is a plugin, so follow that. Divi 4 PHP modules already in a child theme run in Backward Compatibility Mode under Divi 5 until rebuilt; the upgrade guide linked above explains the cost.
Troubleshooting Divi 5 Child Theme Errors
| Symptom | Likely cause | Fix |
|---|---|---|
| “The parent theme is missing. Please install the “Divi” parent theme.” | Template doesn’t match the parent folder, often divi instead of Divi |
Correct the Template line, or reinstall Divi in a folder named Divi |
| Upload fails with a missing style.css message | style.css isn’t directly inside the zip’s top folder |
Zip the divi-child folder itself, as in Option A |
| Child CSS doesn’t apply | Divi’s selector is more specific, or a cached file | Inspect the element, raise Version, Clear CSS Cache, purge caches |
Critical error after editing functions.php |
A PHP syntax error | Undo the last edit over SFTP or your host’s file manager |
| Visual Builder won’t load after the switch | Child theme code conflicts with the builder | Turn on Safe Mode in Divi → Support Center to test without the child theme |
| Global presets won’t save | Child of a renamed Divi folder (fixed in 5.14.0) | Update Divi; keep the parent folder named Divi |
| Menus or widgets missing | Per-theme settings didn’t map across | Reassign them using your backup JSON |
Per Elegant Themes’ Support Center article, Safe Mode turns off child themes, third-party plugins and custom code for your login only. If the problem goes away, your code or a plugin is the cause.
Frequently Asked Questions
Do I need a child theme for Divi 5?
Only if you need PHP or changes to Divi’s template files. Custom CSS fits in Theme Options, page settings or presets, scripts go in the Integration tab, and icon fonts go through the Icon Manager. PHP can also live in a must-use plugin, which is what this site uses instead of a child theme.
How do I create a Divi 5 child theme?
Create a divi-child folder with a style.css whose header contains Theme Name: Divi Child and Template: Divi, then zip and upload it under Appearance → Themes. Divi 5 loads the child stylesheet itself, so skip @import and enqueue code.
Is there a Divi 5 child theme generator or download?
You don’t need one, because a child theme can be a single style.css. WP-CLI’s wp scaffold child-theme generates one, but replace its functions.php. The Child Theme Configurator plugin was last updated in June 2025 and warns it isn’t tested with recent WordPress releases. Check any download for @import lines and Divi 5 compatibility.
Will my Divi 4 child theme work with Divi 5?
Usually, because the child theme mechanism belongs to WordPress, not Divi. Test it on staging and check three things: remove any @import of Divi’s stylesheet, review CSS written for Divi 4 markup, and expect custom PHP modules to run in Backward Compatibility Mode until they’re rebuilt.
How do I add custom fonts to Divi 5 with a child theme?
Put the WOFF2 files in a fonts folder inside the child theme, declare them with @font-face in its style.css and apply them with CSS. Elegant Themes says WOFF and WOFF2 fonts won’t work in Divi’s own font upload even after allowing those file types. Icon fonts are simpler: use the Icon Manager.
Next Steps
Decide with the table at the top, build the child theme if you need one, and switch on staging with the backup commands and checklist before touching the live site. If something breaks afterwards, such as the builder not loading or a broken mobile menu, work through these fixes for common Divi 5 problems.

