• Looking to start an Amazon Affiliate Store?

    Associate-O-Matic

How to Change Your WordPress Theme Without Losing Your Widgets (or your composure)

If you’re a regular reader of WPM, you may have noticed that I’ve changed the look and feel of the site recently. While changing themes, I ran into a Widgets issue that I had forgotten about. Sometimes when changing themes, the new theme you’ve chosen won’t display your Widgets properly. This is kind of a big deal, especially for those WordPress users who are unaware and complete a theme change, only to discover their Widgets are gone.

Day 27 :: Some days

Now this isn’t such a big deal for standard WordPress Widgets like Pages, Categories, and Archives, but like many of you, I have created several Text Widgets that contain hand-written code, custom scripts, and forms. I also use the Query Posts Widget which contains hand-entered parameters. So, how do we avoid disaster?

Why Does This Happen?

An explanation from Justin Tadlock:

Basically, widget areas (aka sidebars) with unique IDs will throw things off. Widgets are added according to a widget area’s ID. When you change themes that have different IDs, the widgets are no longer where you might expect them to be.

How to Avoid Trouble?

Before changing your theme, do the following:

1. Get the right tool for the job.

The first thing you’ll want to do is download the Widgets Reset plugin, again, from Justin Tadlock. This plugin will allow to you completely reset your WordPress Widgets to the default WordPress settings. Notice the emphasis and beware from the plugin’s site:

It’s not for moving widgets, saving widgets, or anything of the sort. When I say it resets your widgets, I really mean it. The slate is wiped completely clean.

Install and activate this plugin, but DO NOT USE IT YET.

2. Backup your Widgets.

Unfortunately, neither the plugin above, nor any other automated method I’m aware of allows you to backup your Widgets. You’re going to have to go “old school” and do it manually. In your WordPress backend, go to the Widgets settings and start copying and pasting the code from each of your Widgets into a simple text document. I had over a dozen Widgets, and most had the Widget Logic plugin applied, so it took some time.

Now Breathe Easy, Almost.

Now that your certain your Widgets are all backed up properly, go into the Appearance tab and change your theme. With any luck, your Widgets (or some of them) will be preserved, but most likely you will have lost some, if not all. At this stage, you may also notice that when you go into the Widgets area, there will be some Widgets listed, but they will be missing the “Add” button. Weird huh? Those Widgets are now in “Limbo”. The good news is that hopefully you’ve installed the Widgets Reset plugin. If so, simply navigate to “Widgets Reset” under the Appearance tab and reset the Widgets. You should now see all your Widgets available with an “Add” button.

Put the Pieces Back Together.

Now for the manual labor. You’ll need to recreate each Widget you had previously by using the code you’ve copied into your backup text file. Don’t worry, it goes pretty fast. I had recreated most of the Widgets I had within about 10 minutes.

Also, it was a great time for me to review the Widgets I had and give a couple of them the boot.

This entry was posted in Blogging Tips, Blogging Tools, WordPress Tutorials and tagged , . Bookmark the permalink. Post a comment or leave a trackback: Trackback URL.

13 Comments

  1. Posted June 1, 2009 at 6:06 am | Permalink

    I have another wp blog that I don’t use. It has the same layout as my main one, so whenever I want to change something I test it out on the backup blog first.

  2. rgregory
    Posted June 1, 2009 at 9:12 am | Permalink

    A switch to Thematic? Why the change? I went the other way from thematic to hybrid. I found Hybrid worked more like I wish Thematic did.

  3. Posted June 1, 2009 at 9:31 am | Permalink

    @ rgregory,

    I still love the Hybrid framework, but I was really aching to go to a more minimalist look, and the default Thematic style was close to what I wanted. I am also evaluating it for another project…

    …however, after all I’ve been hearing about Thematic lately, I was a bit surprised at the lack of solid documentation, especially as compared to Hybrid.

    Time will tell if it stays but so far it feels good:)

  4. Posted June 2, 2009 at 1:37 pm | Permalink

    This really help me out with my WordPress theme. Thank you for this wonderful information and I really appeciated this. In return, I should tell this to my friend.

  5. Posted June 2, 2009 at 1:40 pm | Permalink

    Hi Alexander,

    You’re very welcome, I’m glad I could help, please share my site with all your friends:)

  6. Posted June 7, 2009 at 1:44 am | Permalink

    I have used Hybrid News in my other blog but since I don’t subscribe to become premium member than I don’t know how to tweak the theme to its best performance, so far I just use a standard default performance and feeling good about it because of its cool design. And yes I tried Widget reset and it brought back my widget to its place.

    Software For Downloads last blog post..How-To: Setup iTunes DJ on Your Mac and iPhone

  7. Posted July 22, 2009 at 10:43 am | Permalink

    thank you i am always looking for ways to customize my things without changing the least amount of things. Very helpful post

  8. Posted September 25, 2009 at 12:11 am | Permalink

    When changing a theme, if you change back will everything be the same as it was or will it be completely lost?

  9. Posted September 25, 2009 at 7:15 am | Permalink

    Hi Zac,

    Changing your theme is just like changing your shirt, everything should stay the same. However, like something falling out of your shirt pocket and getting lost, sometimes the same thing happens to widgets. I can’t guarantee that you won’t lose widgets.

    Just follow the advice above and manually backup your widget content into a simple text file and you won’t have anything to worry about.

    p.s. You may want to consider using Amazon affiliate links on your reviews of things Keebler Cookie Crunch Cereal.

  10. Posted September 25, 2009 at 8:16 am | Permalink

    Thanks Adam, I’ll be sure to back my widgets up before trying anything!

    And I just signed on with Amazon Affiliates. Thanks for pointing that out to me, I didn’t even know a program existed with Amazon.

    Thanks again for everything, man!
    .-= Zac´s last blog ..[Tech Review] Schwinn 12-Function Bicycle Speedometer =-.

  11. Posted September 25, 2009 at 8:32 am | Permalink

    Hey no problem, glad I can help:)

    Be sure to check out this plugin to make adding affiliate links super easy…
    http://wordpress.org/extend/plugins/amazon-reloaded-for-wordpress/

  12. Posted October 9, 2009 at 8:51 am | Permalink

    You have some great materials. But, what I don’t understand is your failure to use hyperlinks in both your email (no www-just wordpressmodder.org) or on your page for a home page. It’s a mystery to me.
    .-= Tom Justin´s last blog ..Is The Pain Worth It? =-.

  13. Posted October 9, 2009 at 9:13 am | Permalink

    Hi Tom,

    Thanks for pointing those things out. I changed some things on the site recently and some stuff is still not as it should be.

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Advertise Here

    Interested in advertising your site or service? Drop me a line here.