61 Responses

  1. david (b)
    david (b) March 3, 2009 at 8:24 pm | | Reply

    I recently encountered this problem, but remembered where it was hiding.

    I think I plugin’s an awkward solution to this problem; the core of WordPress should feature this functionality in some way. Either with a prompt before you change themes (if you were using widgets and it had more than the standard) or with a way to reset them. Perhaps a combination of the two is the best solution.

    I’m also thinking that perhaps widget makers should always allow more than one widget to exist. I can’t think of a good reason that you wouldn’t want to allow multiple instances of it. (Having said that, I’m not 100% sure how to do it. I need to look into that.)

  2. david (b)
    david (b) March 3, 2009 at 10:06 pm | | Reply

    Justin (No comment threading, huh? (Though I don’t think I have it running on any public site either…)) — Your point that it’s something of a feature is sound, but it’s a problematic one. The issue is that there are two basic usage cases: those who want a sidebar with the same stuff regardless of the theme they decide to use today and those who want to use a sidebar to customize the workings of a specific theme.

    The solution that works well for the first case–to always keep all widgets intact when switching themes–fails in the second. The better solution for the second case is to have WordPress remember what widgets are where on a per theme basis, but release them when an individual case is not being used.

    The more I think about it, though, the more I think the current solution could be the best. It’s very likely that the first case I mention is more common than the second. And that few themes have more than one widgetable area. And that average users rarely change their theme or widgets after they’ve found a configuration they like.

  3. Nathan Rice
    Nathan Rice March 3, 2009 at 10:10 pm | | Reply

    Figuring this one out saved my butt on a client project.
    http://comox.textdrive.com/pipermail/wp-hackers/2008-December/023354.html

  4. Andrew
    Andrew March 4, 2009 at 3:44 pm | | Reply

    I think if I were building the widget system I probably would have automatically unregistered any widgets that were attached to sidebars that didn’t exist.

    There are other options, for example, registering any sidebars that the theme didn’t register but had widgets applied to them so the widgets could be removed; that would be fairly simple to do as a plugin, or even better having my preferred option but with a way to save widget settings as an xml file so the settings could be reloaded, or even for a default set to be available as part of a theme,

  5. Ptah Dunbar
    Ptah Dunbar March 5, 2009 at 12:15 am | | Reply

    I used to always wonder where my widgets went after switching themes. After peeking around the options db, I saw the “sidebars_widgets” field. So I pretty much did what NR posted the manual way :)

    I also tweeted about presetting widgets once a theme is activated. Plan on hacking on that pretty soon.

  6. baron
    baron March 5, 2009 at 10:53 am | | Reply

    hi. Thanks for plugin

    perfect.

    Regards

  7. dinu
    dinu March 7, 2009 at 12:21 pm | | Reply

    I had lost lot of widgets while changing themes … now this plugin saved me :D thanks a lot ..

  8. keep informed
    keep informed March 8, 2009 at 9:44 am | | Reply

    Ma frend… Great Job… is there any compilations of the plugins you made?

  9. Annie Anderson
    Annie Anderson March 16, 2009 at 8:12 pm | | Reply

    Justin,

    Great plugin! It saved my life. I lost half my widgets when I updated my theme a couple days ago and it was driving me nuts!

    Your plugin is awesome! It did the trick. I think it’s one of the most fabulous plugins I’ve ever used.

    Thanks a lot.

    ~ Annie

  10. Chris Hajer
    Chris Hajer March 18, 2009 at 4:23 pm | | Reply

    Holy cow Justin, your timing couldn’t have been better. I learned of this problem when you first wrote about it a couple weeks ago. I didn’t have a need for the plugin but I did tuck the information away in the back of my brain. Then, today, all of the sudden half my widgets stopped working, on five sites, after migrating to a new domain and new server. I knew immediately what the problem was and used your plugin to set things straight.

    Thanks very much for bringing attention to this problem and providing the simple fix.

    Cheers

  11. Naqqash M Khan
    Naqqash M Khan March 23, 2009 at 5:24 pm | | Reply

    Hey buddy! I want to say my lodz of thanksssss
    This widgets shit made me so much tensed:(
    and u blog came like an angel.
    thanks alot

    Allah Bless YOU

  12. James
    James April 3, 2009 at 11:30 am | | Reply

    Another incredibly satisfied user. I will tweet when I get the chance to properly sing its praises…

    James

  13. Katie Brooks
    Katie Brooks April 5, 2009 at 7:39 am | | Reply

    I’m a little confused about why you would need a plugin for this. There is a REALLY simple fix that works for this problem:

    This specifically deals with the problems of disappearing widgets after theme changes.

  14. Gavan Watson
    Gavan Watson April 29, 2009 at 4:59 pm | | Reply

    Thanks for the plugin; it solved my case of disappearing widgets after moving one host to another.

  15. grateful
    grateful May 2, 2009 at 9:32 pm | | Reply

    Thanks, Justin! This post and solutions are a lifesaver.

  16. Jason
    Jason May 4, 2009 at 11:03 am | | Reply

    Used your theme, but came up with error. Now I have a space with all sorts of nonsense text showing up at the top of my blog: systemsofsupport.org/udlblog. Please advise.

  17. Jason
    Jason May 4, 2009 at 11:33 am | | Reply

    Sorry, that should have read that I used your plugin (widget reset)…

  18. Jason
    Jason May 4, 2009 at 1:14 pm | | Reply

    I apologize for all of the posts. Just in case someone else has this problem. I ended up having to delete entire directory from blog. Luckily my host makes a daily backup so I was able to restore site from it.

  19. Sarah Flashing
    Sarah Flashing May 25, 2009 at 11:27 am | | Reply

    This widget is great, it installs easy to reset my widgets, however it didn’t fix the widgets that “disappeared” as they were moved around in the wp admin section yet continue to appear on the site. I’ve tried to remove them through phpmyadmin to no avail. Any suggestions?

  20. Peter
    Peter May 27, 2009 at 3:16 pm | | Reply

    Thanks for this – found this post on google. I did it the manual way and it took just a few secs and I was back in business. I heard of another plugin called widget slayer (?) but after the fact.

    Cheers.

  21. Jordanna
    Jordanna May 29, 2009 at 7:05 pm | | Reply

    Hi
    I have a similar problem with widgets when I switched to a new theme, then switched back, so thought I’d try the above line of code. I’m using WP 2.7.1, Magazine Basic 2.4.2, 1024wide, 2 sidebars. The problem is the selected widgets (search, tags, categoires, calander and archieves) on the right-hand sidebar are also duplicated (ghosted) on the left-sidebar too. The left-sidebar has recent comments and text widgets selected. The duplication of the right-sidebar widgets positions itself below the left sidebar. So I thought I’d use the code above just to clear them all out. These ghost widgets displayed on the main blog page (not on a post page).

    In Dashboard-Appearance-Widgets the ghost widges are listed as unavailable but are not in the list on the right of selected widgets, so therefore they can not be removed. The effect of using the above line cleared only the left-sidebar widgets that had been selected. The previously selected right-sidebar and its ghost duplicate positioned on the lower left were not cleared, but remained. I placed the line of code at the very top of functions.php. Any advice on solutions I might try to resolve this problem would be appreciated. I’m a newbie and this is driving me mad, well a little bit! Thanks.

  22. Rich
    Rich June 2, 2009 at 8:27 am | | Reply

    Thanks for the tip Justin! – Have been testing custom widgets in templates and quickly managed to assign widgets to sidebars we had removed. Adding the line into function.php works like a charm.

  23. Will
    Will June 2, 2009 at 5:32 pm | | Reply

    You just saved me from an hour of code hunting. Thanks!

  24. Scott
    Scott June 6, 2009 at 11:43 am | | Reply

    Thanks, I’d spent far to long trying to sort this out, your one line of code fixed it for me. Many thanks

  25. WordPress Widget Problems? June 12, 2009 at 5:39 pm |
  26. Bill Courtney
    Bill Courtney June 14, 2009 at 7:13 am | | Reply

    My widgets did just all disappear in 2.8 and I am using the same theme as before. The reset widget does not seem compatible with 2.8.

    I restored my settings and deactivated my widget cache and hope it does not happen again, as it happened last time when i cleared the widget cache.

    Bill

  27. Ron
    Ron July 3, 2009 at 2:04 pm | | Reply

    This plugin is super helpful. NOTE: The WordPress Plugin … area … place where you get them says, “Compatible up to: 2.7.1″ and gives a warning. That will put some folk off using it. In truth, it worked great on my 2.8.

    Perhaps you can get WordPress to update their message Justin.

    It sure is a life-saver as WP 2.8 stored a bunch of Widgets I had experimented with but didn’t realize were saved somewhere. Those experiments caused actual widgets not to work until I downloaded this.

  28. harren maben
    harren maben July 27, 2009 at 3:53 am | | Reply

    justin i have desperate need of this idea and got if from here , i want to thank for make this as a plugin and very handy for everyone.

  29. Terry van Diver
    Terry van Diver August 18, 2009 at 12:29 pm | | Reply

    I attempted to upload your Widgets Reset php file and here is what i got!

    YIKES! What can I do now? Thanks, Justin.

    Terry V

  30. flora
    flora September 14, 2009 at 11:34 pm | | Reply

    I upgraded to wordpress 2.84 with Magazine Basic theme and the Tags widget has disappeared from the list of available widgets and inactive widgets. I’ve used your widgets reset, it removes the widgets from Sidebar 1 and Sidebar 2 on the widgets page, but 4 of the widgets show on the site sidebar, including the tags list. On another website when I upgraded, I used your widgets reset plugin and it solved my problem. Does your widgets reset work with wordpress version 2.84? Is there something else I can try to resolve this?

  31. flora
    flora September 15, 2009 at 8:40 am | | Reply

    Having no luck with the plugin getting my tag_cloud widget back, I found a forum topic at wordpress.org helpful in resolving this. Here’s what I did. Perhaps you can make the widget accomplish this so that others do not have this problem.
    I went into the database and restored the widget_tag_cloud row from a database backup.Changed option_value
    from a:2:{s:5:”title”;s:6:”Topics”;s:12:”_multiwidget”;i:1;}
    to a:3:{i:2;a:0:{}i:3;a:1:{s:5:”title”;s:6:”Topics”;}s:12:”_multiwidget”;i:1;}
    The tag cloud widget reappeared in the widgets screen and I was able to add it back to the sidebar. Resolved for now.

  32. Kevin Newman
    Kevin Newman October 29, 2009 at 3:09 pm | | Reply

    Follow flora’s clue, I checked the value of the widget options in a fresh Wordpress install, and found they were all the same:

    a:2:{i:2;a:0:{}s:12:”_multiwidget”;i:1;}

    I updated all mine to match, and the missing Widgets came back.

    +1 to add a SQL update to Widget Reset plugin. ;-)

  33. lalacan
    lalacan November 7, 2009 at 8:16 am | | Reply

    Great plugin, will use this for my new blog.
    Thank you

  34. John Fowler
    John Fowler November 17, 2009 at 2:32 pm | | Reply

    Hi Justin
    Just installed your Reset plugin and it looks and works beautifully. It was just what I needed to implement contextual sidebars. Thanks for your work.

    Odd problem though: I uploaded via ftp instead of WP Admin, and the plugin activated itself without showing up at all in the Plugins Panel. I deleted it from my server via ftp, expecting it to disappear so that I could upload via WP and hopefully have it appear properly in the Plugins Panel.

    But…it is still installed after being deleted from my server. I love the plugin, but have no control over it status now.

    Any suggestions?

    Cheers

  35. John Fowler
    John Fowler November 17, 2009 at 3:57 pm | | Reply

    Ignore last post…for starters I meant Widgets Reloaded, not Reset. And I solved the problem myself anyway.

    Thanks again for the great plugin!

  36. Chris Masse
    Chris Masse November 29, 2009 at 4:20 am | | Reply

    Hi folks,

    Thanks for this plugin.

    Should I use it with WP 2.8.6 (and with WP 2.9)?

    Thanks,

    chris

  37. Ryan
    Ryan December 23, 2009 at 11:21 am | | Reply

    I get an error on my sidebar when I run the Widget reset:

    Warning: array_key_exists() [function.array-key-exists]: The second argument should be either an array or an object in /home/content/o/a/r/oaramblinknigh/html/wp-includes/widgets.php on line 852

    Instead of clearing out the widgets, the error appears and the widgets remain.

    Any ideas?

    1. Mike
      Mike January 16, 2011 at 7:14 pm | | Reply

      Was there ever a fix found for Ryan’s problem?

  38. Moridin
    Moridin January 2, 2010 at 3:26 pm | | Reply

    My Tag Cloud widget along with a few others has disappeared some time ago and I can’t seem to get them back (hardcoded the tag cloud at the moment).

    Widget Reset is not helping at all – doesn’t seem to be doing anything.

    I’m at the latest 2.8.

    Any ideas? Help please! :-)

  39. James
    James January 10, 2010 at 11:44 pm | | Reply

    Thanks for the great plugin! I think it’s really cool you explain that the plugin isn’t needed and provide the code to do it manually. Good deal!

  40. Genduk
    Genduk January 25, 2010 at 10:16 am | | Reply

    Thanks for this plugin, it’s great.

  41. Jacky Liang
    Jacky Liang September 27, 2010 at 10:20 pm | | Reply

    I don’t mean to disrupt the conversation here, but Do you have any idea why there are Blank Spaces inside my Widgets Panel? Somehow I can’t get a fix for that. Email is inside. Thanks

  42. BoiteaWeb
    BoiteaWeb December 19, 2011 at 5:09 am | | Reply

    Hello

    i think a security token is missing here, so a XSRF vulnerability is present.
    Not a big deal, it will just erase the widget from sidebar, pretty anoying …
    See you :)

    Julio

Leave a Reply

By submitting a comment here you grant this site a perpetual license to reproduce your words and name/Web site in attribution.

Please use your real name or a pseudonym (i.e., pen name, alias, nom de plume) when commenting. If you add your site name, company name, or something completely random, I'll likely change it to whatever I want.