1 、禁用修订版本和自动草稿在 wp-config.php
文件中设置 WP_POST_REVISIONS
为 false
,有就直接改,没有就添加。
define('WP_POST_REVISIONS', false);
2 、删除掉仪表盘的小工具,添加到主题或子主题的 function.php
,需要删除的项目可以按需调整
/**
* Remove WordPress Dashboard Widgets
*
*/
add_action( 'wp_dashboard_setup', 'wei33010_disable_dashboard_widgets' );
function wei33010_disable_dashboard_widgets()
{
remove_meta_box( 'dashboard_incoming_links', 'dashboard', 'normal' ); // Incoming Links
remove_meta_box( 'dashboard_plugins', 'dashboard', 'normal' ); // Plugins
remove_meta_box( 'dashboard_quick_press', 'dashboard', 'side' ); // Quick Press
remove_meta_box( 'dashboard_recent_drafts', 'dashboard', 'side' ); // Recent Drafts
remove_meta_box( 'dashboard_primary', 'dashboard', 'side' ); // WordPress blog
remove_meta_box( 'dashboard_secondary', 'dashboard', 'side' ); // Other WordPress News
remove_action( 'welcome_panel', 'wp_welcome_panel' ); // Remove WordPress Welcome Panel
}
3 、不想用代码就用插件
Disable WordPress Events and News Dashboard Widget
Disable Gutenberg Autosave