One button to change all settings in theme customizer?

There is a function called remove_theme_mods that will kill all theme mods. Beware, however, that this will not only remove the mods that you have defined in your theme using the customizer API. It will also target other mods, such as the menu locations. Widget positions are currently defined as options, not as mods, but this may change in the future. WordPress is likely to move more stuff from options to mods, making remove_theme_mods all the more dangerous to use.

The best approach is to arrange all mods that belong to the theme proper in an array. You can then loop through that array and remove the individual mods with remove_theme_mod.

Leave a Comment