WordPress does not have build in functionality for exporting or importing widgets. This can be a pain if you want to transfer widgets from one location (e.g. a test website) to another location (e.g. a live website).
When you deactivate a WordPress theme and activate another WordPress theme, widget settings can sometimes be lost too. I experienced this myself when I changed my blog design the other month. As a result of this, I had to configure some widgets again.
Thankfully, there are good solutions to this problem in the official WordPress plugin directory.
In this article, I would like to show you two WordPress plugins that help you backup, transfer, and restore WordPress widgets.
Widget Importer & Exporter is a straight forward plugin that allows you to backup widgets in JSON format with a .wie extension. All you have to do is click on the export widgets button in order to download a backup of all your widgets.
To test the plugin, I backed up the widgets on this blog and restored them on my test website. As you can see, the plugin imported all widgets that it could. Widgets for plugins that are not activated on my test website were not imported (as you would expect).
Another good option is Widget Settings Importer/Exporter. If you want more control over what widgets you backup, this is the plugin to choose. The plugin lets you select which widgets you export.
If a sidebar is not available during the import process, corresponding widgets will not be imported. It is therefore best to ensure that you have the same theme activated on the exporting and importing website.
If you are looking to transfer widgets from one website to another, or if you simply want to keep a backup of your widgets, then I recommend trying Widget Importer & Exporter or Widget Settings Importer/Exporter. They are both easy to use and will save you the inconvenience of configuring widgets from scratch.