0
votes

I am trying to make a custom dashboard for a customer.

I would like to hide every plugin menu appearing in the dashboard. So far I could hide just wordpress seo adding this code to functions.php:

function hide_yoastseo() {
    remove_action('admin_bar_menu', 'wpseo_admin_bar_menu',95);
    remove_menu_page('wpseo_dashboard');
}
add_action( 'admin_init', 'hide_yoastseo');

However I do not understand the logical here to aplly others plugins.

1

1 Answers

3
votes

I think below function might be helpful to you.

function chetz_remove_admin_menus(){

// Check that the built-in WordPress function remove_menu_page() exists in the current installation
if ( function_exists('remove_menu_page') ) { 

    remove_menu_page( 'plugins.php' ); // Remove the Links tab by providing its slug
}}add_action('admin_menu', 'chetz_remove_admin_menus'); // Add our function to the admin_menu action