This site uses cookies. By continuing to browse the site you are agreeing to our use of cookies.
In some cases, you may need to disable the default WordPress widgets. The WordPress code snippet below will remove the declared widgets from the WordPress widgets area.
Adjust and add the code below on your WordPress theme’s functions.php file.
function ns_unregister_default_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 ' ); unregister_widget( ' WP_Nav_Menu_Widget ' ); unregister_widget( ' Twenty_Eleven_Ephemera_Widget ' ); } add_action( 'widgets_init', 'ns_unregister_default_widgets', 11) ;
Read more about WordPress Widgets API her.
Thank you for seeing my code snippet and feel free to share and comment :).Do you have any interesting changes to your “widget area” that you make or some other cool code snippets that you’d like to share? Let everyone know in the comments what cool tricks you’ve come up with or you can let me know by contacting me (here)