66 Responses

  1. david (b)
    david (b) Published |

    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.)

    Reply
  2. david (b)
    david (b) Published |

    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.

    Reply
  3. Nathan Rice
    Nathan Rice Published |

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

    Reply
  4. Andrew
    Andrew Published |

    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,

    Reply
  5. WordPress Plugin Releases for 03/04 | Weblog Tools Collection
  6. Ptah Dunbar
    Ptah Dunbar Published |

    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.

    Reply
  7. Droppin’ knowledge on WordPress: How to preset widgets to widget areas
  8. baron
    baron Published |

    hi. Thanks for plugin

    perfect.

    Regards

    Reply
  9. dinu
    dinu Published |

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

    Reply
  10. keep informed
    keep informed Published |

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

    Reply
  11. Annie Anderson
    Annie Anderson Published |

    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

    Reply
  12. Justin’s plugin saved my blog « Annie Anderson | Blog
  13. Chris Hajer
    Chris Hajer Published |

    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

    Reply
  14. Weblog Tools Collection: WordPress Plugin Releases for 03/04 | Aslifm Blogu
  15. Naqqash M Khan
    Naqqash M Khan Published |

    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

    Reply
  16. Resetting your WordPress widgets at Mostly Harmless
  17. James
    James Published |

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

    James

    Reply
  18. Katie Brooks
    Katie Brooks Published |

    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.

    Reply
  19. Plugin Review: Widgets Reset - RiteTurnOnly.com
  20. WPWeekly Episode 50 - Interview With Cathy Perkins
  21. Gavan Watson
    Gavan Watson Published |

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

    Reply
  22. grateful
    grateful Published |

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

    Reply
  23. Jason
    Jason Published |

    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.

    Reply
  24. Jason
    Jason Published |

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

    Reply
  25. Jason
    Jason Published |

    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.

    Reply
  26. Wordpress Blogging: Invisible Widgets | Facts You Should Know For MLM Success
  27. Sarah Flashing
    Sarah Flashing Published |

    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?

    Reply
  28. Peter
    Peter Published |

    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.

    Reply
  29. Jordanna
    Jordanna Published |

    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.

    Reply
  30. Rich
    Rich Published |

    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.

    Reply
  31. Will
    Will Published |

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

    Reply
  32. Scott
    Scott Published |

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

    Reply
  33. WordPress Widget Problems?
    WordPress Widget Problems? at |
  34. Bill Courtney
    Bill Courtney Published |

    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

    Reply
  35. Ron
    Ron Published |

    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.

    Reply
  36. How to upgrade to WordPress 2.8 Baker | H5N1 Avian bird flu forecast blog
  37. harren maben
    harren maben Published |

    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.

    Reply
  38. 3 Cara Mengembalikan Widget Yang Hilang - Widget Tanpa Add — Blog SEO
  39. Found Not Lost » Blog Archive » The Case of the Disappearing Widgets
  40. Tutorial To Fix Bring Back Widgets That Disappear After Changing Theme | SEO Blog & Technology
  41. Terry van Diver
    Terry van Diver Published |

    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

    Reply
  42. flora
    flora Published |

    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?

    Reply
  43. flora
    flora Published |

    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.

    Reply
  44. Kevin Newman
    Kevin Newman Published |

    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. ;-)

    Reply
  45. lalacan
    lalacan Published |

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

    Reply
  46. John Fowler
    John Fowler Published |

    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

    Reply
  47. John Fowler
    John Fowler Published |

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

    Thanks again for the great plugin!

    Reply
  48. Chris Masse
    Chris Masse Published |

    Hi folks,

    Thanks for this plugin.

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

    Thanks,

    chris

    Reply
  49. Ryan
    Ryan Published |

    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?

    Reply
    1. Mike
      Mike Published |

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

      Reply
  50. Moridin
    Moridin Published |

    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! :-)

    Reply
  51. James
    James Published |

    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!

    Reply
  52. Genduk
    Genduk Published |

    Thanks for this plugin, it’s great.

    Reply
  53. Jacky Liang
    Jacky Liang Published |

    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

    Reply
  54. BoiteaWeb
    BoiteaWeb Published |

    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

    Reply
  55. Dan A
    Dan A Published |

    You just saved my ass! Hours of work. Thanks so much!!!!!!!!!!!!!!!!!!!!!!!!!!!!

    Reply
  56. jorge benjumea
    jorge benjumea Published |

    Hi,

    Im trying to hide, not to remove, the “Inactive widgets” metabox on “appearance->widgets” menu using functions.php… so nobody can see this metabox.

    But after many many hours searching on the web I doesnt found how :(

    Any help?

    Regards,
    George

    Reply
  57. Martin Lees
    Martin Lees Published |

    Hi,

    I inserted the coding in the functions.php file and now I just get a blank page saying this
    Parse error: syntax error, unexpected ‘<' in /home/dearnevi/public_html/wp-content/themes/oxygen/admin/functions-admin.php on line 213

    everytime I try to do anything, can you help please?

    Many Thanks

    Reply
  58. Mark Law
    Mark Law Published |

    Thanks for this, it is still usefull 5 years later :)

    My widget content had all disappeared, I got it back by using your functions.php method, thanks!

    Reply

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.

css.php