WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to remove/add widgets from/to the Available Widgets pool (either by plugin or editing core files)?

There are 3 widget files located at:

/wp-includes/widgets.php

/wp-admin/widgets.php

/wp-admin/includes/widgets.php

I have tried to change both the code and the widget variables but nothing happened.

thanks

share|improve this question

You can use the function unregister_widget to remove widgets.

E.g. you can remove the Calendar widget with:

function my_widgets_init() {
    unregister_widget( 'WP_Widget_Calendar' );
}
add_action('widgets_init', 'my_widgets_init');

To add widgets, use the Widgets API.

share|improve this answer

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.