Of course, these gadgets can be removed. It is unclear how much it can help with performance, but it may be helpful to some servers with poor performance. Some friends who like simplicity do not like to hide but directly remove them.
The following describes how to remove the WordPress dashboard page and built-in gadgets.
Remove some Built-in WordPress gadgets
Just throw the following function into functions. php. Note: You can comment out one or more of the following rows based on your actual needs:
Function Yusi_remove_meta_widget () {unregister_widget ('WP _ Widget_Pages '); unregister_widget ('WP _ Widget_Calendar'); // unregister_widget ('WP _ wid_archives '); unregister_widget ('WP _ Widget_Links '); unregister_widget ('WP _ Widget_Meta'); // unregister_widget ('WP _ Widget_Search '); combine ('WP _ Widget_Text '); // unregister_widget ('WP _ Widget_Categories '); unregister_widget ('WP _ login'); unregister_widget ('WP _ Widget_RSS '); unregister_widget ('WP _ Widget_Tag_Cloud '); // unregister_widget ('WP _ Nav_Menu_Widget');/* register my custom widget */register_widget ('WP _ Widget_Meta_Mod ');} add_action ('widgets _ init ', 'yusi _ remove_meta_widget', 11 );
You can remove the code of a small tool in the WordPress background based on the actual needs of a project. If it is not commented out, it will be removed.
Remove widgets loaded on the WordPress dashboard page
Although every WordPress background administrator can close any existing tool in "option settings" at the top of the WordPress dashboard interface, for bloggers who do not know the technology, it may be better to not display these gadgets in the WordPress background.
Function Yusi_remove_dashboard_widgets () {global $ wp_meta_boxes; unset ($ wp_meta_boxes ['dashboard'] ['side'] ['core'] ['dashboard _ quick_press ']); unset ($ wp_meta_boxes ['dashboard'] ['normal'] ['core'] ['dashboard _ incoming_links ']); unset ($ wp_meta_boxes ['dashboard '] ['normal'] ['core'] ['dashboard _ right_now']); unset ($ wp_meta_boxes ['dashboard'] ['normal'] ['core'] ['dashboard _ ins Ins']); unset ($ wp_meta_boxes ['dashboard'] ['normal'] ['core'] ['dashboard _ recent_drafts ']); unset ($ wp_meta_boxes ['dashboard'] ['normal'] ['core'] ['dashboard _ recent_comments ']); unset ($ wp_meta_boxes ['dashboard'] ['DD'] ['core'] ['dashboard _ primary ']); unset ($ wp_meta_boxes ['dashboard'] ['DD'] ['core'] ['dashboard _ secondary ']);} add_action ('WP _ dashboard_setup ', 'yusi _ remove_dashboard_widgets', 11 );
You can safely remove all of this, and decide whether to leave a small tool based on your needs.