Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I've been working with widgets a lot lately and have amassed a ton of widgets in the inactive widgets collection.

Can someone share a script or plugin that will remove all inactive widgets from the site?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

something like:

$widgets = get_option('sidebars_widgets');
$widgets['wp_inactive_widgets'] = array();
update_option('sidebars_widgets', $widgets);
share|improve this answer
    
@OTP: Works great. What if I want to remove ALL widgets? –  Scott B Mar 30 '11 at 18:02
    
then the second line should be $widgets = array(); or just use update_option('sidebars_widgets', array()); –  onetrickpony Mar 30 '11 at 18:05

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.