WordPress: Copy Parent Theme Customization to a Child Theme

Published by James Hess on

I ran in circles trying to determine why activating my child theme drastically changed the styling of my WordPress website. I had verified that the parent style sheet was working, but still the website lost important styling when the child theme was turned on.

Ideally, you’ve created your child theme when first developing your website, but that’s not always the case. I had inherited a WordPress project that had extensive customization done on the parent theme and was trying to retroactively implementing a child theme.

After some long investigation I determined that the parent theme customization added under Appearance > Customize in the WordPress dashboard did not automatically apply to the child theme. Moving these theme customization needed to be done manually. This can be done via the WordPress dashboard under Appearance > Customize, which can be tedious, or you can copy all customization at once via the database.

You’ll need to access your WordPress website’s database via phpMyAdmin or other means. Navigate to the wp_options table and find the records where option name is theme_mods_<your-theme-name>. There should be at least two of these records, one for your parent theme and one for your child theme. Copy the option value from your parent theme to the option value for the child theme and that’s it. All customization should now be copied to your child theme, which you can verify via the WordPress dashboard.

Refresh your WordPress website and all should be in order now. Let me know if you have more tips or tricks when creating a child theme for a WordPress website.

Categories: WordPress