How to remove the default widget in wordpress
during use wordpress, you use the plugin and when you see your widget too many widgets, each time you want to add a widget to the sidebar of your search forever know where it is or do you take a long time.
Often the default widget in wordpress we use very little, wandering her up found the answer, you copy the following code to paste into the functions.php file offline, then save and revisit widget view.
add_action( 'widgets_init', 'my_unregister_widgets' );
function my_unregister_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');
}
surprised? lose all the unnecessary widget, you can look at the code to also understand how their purpose and in the right way, you can delete those rows that contain widgets that you still need to spend, it will come back to you only.
A small but very useful trick here, I still spend it today, always use.
very easy, ensuring 100% success without using the plugin at all, I also did not like plugin, it weighs your site, if insufficient, do we use the plugin.
If you copy my post, please remember to link the source to me.
This article is useful for you, press like on my help, encourage writing.
bạn ơi cho mình hỏi, mình muốn xóa mấy widget lặp lại nhìu lần giống như bạn đã viết phía tên, nhưng mà mình không biết tìm thấy cái functions.php nó ở đâu, bạn có thể chỉ cho tôi biết nó nằm ở đâu không?
bạn vào thư mục wp-content/themes/ten-theme-cua-ban/functions.php
Chúc bạn thành công