Sometimes when moving WordPress sites, you may need to save and reuse widget settings from one WordPress installation to another. If a site has just a few widgets, then you can probably do that manually. However, if there are many widgets in multiple sidebars and widget areas, then you need a better solution. In this article, we will show you how to proceed a Widgets Import
WordPress Widgets Import
The WordPress widgets menu (Appearance – Widgets) is where the magic happens. You pick, choose, and customize whichever widgets will grace your blog’s sidebars and footers. And once you have those chosen and set up perfectly — which may take a good, long time — you don’t want to do it again. Especially if you used a lot of custom code snippets or anything else that had to be copy/pasted it over and over.
Ready To Go
Once you have that perfect, head over to the WordPress.org plugin repository and grab yourself the plugin called Widget Importer & Exporter. Obviously install it and activate it, too.
Now you will have a new menu item at Tools – Widget Importer & Exporter. You can access it either in the dashboard sidebar or the Installed Plugins page. Regardless, when you get there, you’ll see buttons for the two things this plugin does best: Import Widgets and Export Widgets. The plugin doesn’t have any other set up than that. Just click and go.
Now, the important part to notice is that under Export Widgets (#2, above), the plugin states that it will create an export file for all active widgets. That means only the widgets that are currently displayed inside a sidebar, footer, or another widgetized area will be exported. So you don’t have to deal with blank copies of the 20 default widgets you may not be using.
Clicking the Export Widgets button will generate a .wie file for your URL that you can save wherever you want.
The .wie filetype is for this plugin only. You can easily see how it exports the data, however, by opening the file in a code editor. WordPress keeps widget data as a serialized array in the database, so that’s what you’re looking at here. Technically, you can go in and find and move this stuff manually using SQL, but I doubt you’d want to.
Importing the file, however, is a little more complicated (but not by much). You will need access to whichever WordPress site you’re transferring the widgets too. Not only access, but you will also need permission to install and activate plugins because you’re going to have to install the Widget Importer & Exporter plugin on the second site as well.
Side note: Notice the different colour used for the admin dashboard? This option can be changed in your user profile, and it is a very good idea when dealing with multiple WordPress installations to use various colour schemes. It helps keep them separated. And it’s kind of a miracle when working on transferring data between two different installations like this. Give it a shot.
Once it’s installed and activated, just click on the widgets Import / Export link or go to the Tools – Widget Importer & Exporter tab. Find the .wie file wherever you saved it on your hard drive or server. When ready, you just have to click the Import Widgets to initiate the process.
Immediately following, the plugin redirects you to the results summary. If everything went smoothly (which it likely did), you will see green imported messages indicating you were successful.
When you check your Appearance – Widgets screen, you get an eye-full of success. All your areas and widgets are exactly like you left them on the initial site.
Perfecto! The moment the import is done, the widgets go live. Simple as pie, as they say.
While you can manually create duplicates of widgets, if you try to import the same widget twice, you won’t be able to. A widget already exists message in an orange text will show instead of the green success one. That way, you don’t have to worry about importing the same widgets that you just exported and pushing live a duplicate of everything. (Which is also protected by changing your dashboard colours, too, remember.)
The widgets that you already have installed on your site are safe, too. Whenever you import anything using this plugin, the new plugins are simply appended to the widgetized areas. Instead of overwriting your existing setup. So as long as you’ve done some house-cleaning so that your sidebar et al don’t overextend their bounds, you may have next to no work to do beyond the import stage.
Because of the way the data is stored in the array within the .wie file, there’s no room for interpretation. The plugin looks for a widget area called Sidebar to dump all your Sidebar‘s widgets into. Same goes for Footer Area #1 and so on. But if you just have Footer A instead, it doesn’t know what to do. There is no 1:1 match. And the array can’t semantically interpret that title as being functionally the same thing.
So it puts anything that it can’t find a place for in your Inactive Widgets area under Appearance – Widgets. That’s where you put your widgets whose settings you want to save, but don’t want to show up on your site. So you maintain the integrity of the import itself, but you do need to go and put them in place manually. No data is lost, though.
See? It’s a really painless, easy process to transfer WordPress widgets from one site to another. A few clicks and you’re done. And if you’re going to a completely new site using the same theme (and haven’t made any customized widget area names), you can be finished with this in a handful of minutes. You did the work ages ago, getting everything just right on the first site, so why reinvent the wheel? Just export that database array as a .wie and toss it into the new site, and you can move onto work that you haven’t done already.