Skip navigation


function unregister_problem_widgets() {
unregister_sidebar_widget('Calendar');
unregister_sidebar_widget('Search');
}
add_action('widgets_init','unregister_problem_widgets');

Widgets plugin has its own action hook for this sort of thing, called “widgets_init”. It happens just after the Widgets plugin registers all its own widgets.

An inferior solution:


function unregister_them() {
unregister_sidebar_widget('Calendar');
unregister_sidebar_widget('Search');
}
add_action('init','unregister_them',10);

The trick is unregistering them after the widgets plugin registers them. Since it registers them using the ‘init’ action hook at priority 5.

Advertisements

3 Comments

  1. Great post Hone!
    Thanks!!

  2. This isn’t working for me. I’m using WP 2.8.2. Is there something new? I’ve tried all sorts of solutions about the internet, just like this one, and IT WON’T WORK. I’ve got it working before, I know, I remember.

  3. I sincerely apologise for three comments now, but I feel I should point anyone else in my situation in the direction of http://wordpress.org/support/topic/281962?replies=2 Things are slightly different as of WordPress 2.8. It took me ages to figure it out.


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: