If you ever decided to use a child theme after working with parent theme for a while, you might discover an issue where your customizer settings on parent theme is missing when switching to child theme even though you use child theme of that particular parent theme.
Parent theme customizer settings are not automatically brought over to child theme when switching.
This happened recently to me when working on a client’s site that uses Astra theme. After solely using Astra theme, the site feels the necessity to use Astra child theme to use custom templates.
I created an Astra child theme, uploaded it to the site, and activated it. But I was surprised the site looked off and far different than when Astra parent theme active.
After digging options
table, I found out how to import customizer settings from parent to child theme.
- Log in to your site’s phpmyadmin
- Go to your
{prefix}options
table - Find records with
option_name
that hastheme_mods
in the beginning of its name. You can run this MySQL query from phpmyadmin to look for the records easily
SELECT * FROM `{prefix}_options
` WHERE option_name LIKE 'theme_mod%'
Make sure you change the {prefix}
with your WordPress database prefix.
- Copy the
option_value
oftheme_mods_parent
. In my case the theme is astra (parent theme’s folder name) so theoption_name
istheme_mods_astra

- Paste the value you copy earlier in step 4 to
theme_mods_child
. In my case it’s astra-child (child theme’s folder name) so theoption_name
istheme_mods_astra-child

After doing these steps, try refreshing your site homepage. And voila! The customizer settings you made in the parent theme, now should be applied to the child theme as well.
If you encounter any issue or have any feedback, please leave a comment below.
Leave your comments below!