Sign up ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have two plugins in the dashboard, SEO Wordpress and Custom Content Type Manager, and for security reasons I want to hide these from dashboard. How to do that?

I tried to hide the SEO Wordpress with this:

// Remove Admin Dashboard menus
 function wp_admin_dashboard_remove_menus() {
     global $menu;
     $restricted = array(('Comments'), __('Users'), __('Updates'), __('wpseo_dashboard'));
     end ($menu);
     while (prev($menu)){
         $value = explode(' ',$menu[key($menu)][0]);
         if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){

 add_action('admin_menu', 'wp_admin_dashboard_remove_menus');

Tried many combinations like:


But the SEO menu did not hide.

share|improve this question
Have you researched anything here? Please, tell us what you found and why it didn't work. – brasofilo Apr 29 '13 at 15:12
The WordPress Seo menu is already limited to users who can manage_options ie. admins, do you have admins who you don't want viewing/using it? I'd have a similar question for the other plugin if i could find the relevant piece of source code, but that's too many files to check via the plugin svn manually. – t31os Apr 29 '13 at 18:24

3 Answers 3

up vote 6 down vote accepted

Wordpress SEO

If you want to remove the admin menu:


you can do that with:

function hide_wpseo() {
       remove_action('admin_menu', 'zeo_options_menu');
add_action( 'init', 'hide_wpseo');

where it will be removed for all users.

WordPress SEO by Yoast

To hide the admin menu:

admin menu

and the admin menu bar:

admin menu bar

one can use:

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

where it will be hidden for all users.

Custom Content Type Manager

Here one can hide the admin menu:

admin menu

from all users with:

function hide_cctm() {
add_action('admin_init', 'hide_cctm');
share|improve this answer
It's already limited to users with manage_options, see: source here. – t31os Apr 29 '13 at 18:25
@birgire i refer to Yoast WordPress SEO plugin. For the code which is above, this is not work. – MikeD Apr 29 '13 at 18:37
@t31os thanks for noticing it ;-) I updated the code to remove it for all users. – birgire Apr 29 '13 at 19:00
@MikeD I hope I got the right plugin this time ;-) – birgire Apr 29 '13 at 19:01
Unbelievable. That was three times (out of five) a slightly wrong name. Right, bilgire? Err, bitgire, no bigire. ;) Sorry, I just had to share my amazement. – tfrommen Apr 29 '13 at 20:50

Do you want to hide it for a specific kind of user like an author? If so, you can use the Advanced Access Manager plugin

With this plugin you can decide what the user(group) has access to in the backend and also what permissions he/she has.

share|improve this answer
thanks for the answer. I want to hide it for the admin. Sorry, but i don't want to use a plugin for this. I try to solve it with a bit of code. – MikeD Apr 29 '13 at 15:45

For removing plugin's menu from multisite dashboard

foreach($GLOBALS[ 'menu' ] as $key => $value) {



For adding menu use add_menu_page();

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.