-
Home
-
WP Dark Mode – WordPress Dark Mode Plugin for Improved Accessibility, Dark Theme, Night Mode, and Social Sharing
- Tips
How to Hide WP Dark Mode Admin Menus
function plt_hide_wp_dark_mode_menus() {
//Hide "WP Dark Mode".
remove_menu_page('wp-dark-mode');
//Hide "WP Dark Mode → Settings".
remove_submenu_page('wp-dark-mode', 'wp-dark-mode');
//Hide "WP Dark Mode → Social Share".
remove_submenu_page('wp-dark-mode', 'wp-dark-mode-social-share');
//Hide "WP Dark Mode → Get Started".
remove_submenu_page('wp-dark-mode', 'wp-dark-mode-get-started');
//Hide "WP Dark Mode → Recommended Plugins".
remove_submenu_page('wp-dark-mode', 'wp-dark-mode-recommended-plugins');
//Hide "WP Dark Mode → Upgrade Now".
remove_submenu_page('wp-dark-mode', 'https://go.wppool.dev/LaSV');
}
add_action('admin_menu', 'plt_hide_wp_dark_mode_menus', 41);
Where do I put this code?
How to Hide the "WP Dark Mode" Dashboard Widget
function plt_hide_wp_dark_mode_dashboard_widgets() {
$screen = get_current_screen();
if ( !$screen ) {
return;
}
//Remove the "WP Dark Mode" widget.
remove_meta_box('wp_dark_mode_dashboard_widget', 'dashboard', 'normal');
}
add_action('wp_dashboard_setup', 'plt_hide_wp_dark_mode_dashboard_widgets', 20);