I want to update a customers blog to a child theme that is based on a newer version of the actual deployed theme. My problem is, the developers of the theme changed the IDs of sidebars. In the old version register_sidebar()
was called without providing an ID, therefor WP used numeric IDs. Now developers named the IDs alphanumerical (home-1
, home-2
, etc).
I couldn’t find out how to copy the widget settings in the database from one sidebar to another. Therefor I registered the new sidebar IDs in the old theme and the old sidebars in the new theme. Than I used the Duplicate Widget Plugin to replicate the widgets in the new sidebars. When I preview the new theme, everything looks good, but upon activation my widgets are gone. Looking into the widget backend and my sidebars are mostly empty, except one or two. Reactivating the old theme and everything’s fine.
I also tried to export and import widget settings, but one plugin didn’t install correctly and the other one exported a mostly empty widget_settings.xml
file shown below.
<?xml version="1.0" encoding="ISO-8859-1"?><widget_settings></widget_settings>
WordPress actually lists all WidgetAreas that aren’t registered. You then are able to drag and drop the widget settings into the new area.