Remove default widgets from WP?

Associate
Joined
20 Sep 2003
Posts
2,361
Location
Scotland
I have a basic wordpress theme setup but I want to remove the default widgets i.e. Search, Archices, Categories and Links. See here:

http://agri-arb.co.uk/

I have removed themn in the backend via the Widgets section but they still show. Doing a bit of searching I found this section of code and tried adding it to the functions.php but didn't work.

Code:
// unregister all default WP Widgets
function unregister_default_wp_widgets() {
    unregister_widget('WP_Widget_Pages');
    unregister_widget('WP_Widget_Calendar');
    unregister_widget('WP_Widget_Archives');
    unregister_widget('WP_Widget_Links');
    unregister_widget('WP_Widget_Meta');
    unregister_widget('WP_Widget_Search');
    unregister_widget('WP_Widget_Text');
    unregister_widget('WP_Widget_Categories');
    unregister_widget('WP_Widget_Recent_Posts');
    unregister_widget('WP_Widget_Recent_Comments');
    unregister_widget('WP_Widget_RSS');
    unregister_widget('WP_Widget_Tag_Cloud');
}
add_action('widgets_init', 'unregister_default_wp_widgets', 1);

Version is 3.1.8

Cheers
 
Back
Top Bottom