WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've successfully used the code from the post: Restrict ADMIN menu items based on username, replace username with an actual user's name.

The problem is the theme still shows on the main dashboard and by clicking on the theme name the admin is taken to the appearance menu which had been hidden by using the code.

Any thoughts how to get around this?

Here is the code from the post mentioned:

function remove_menus()
global $menu;
global $current_user;

if($current_user->user_login == 'clients-username')
    $restricted = array(__('Posts'),
    end ($menu);
    while (prev($menu)){
        $value = explode(' ',$menu[key($menu)][0]);
        if(in_array($value[0] != NULL?$value[0]:"" , $restricted)){unset($menu[key($menu)]);}
    }// end while

}// end if
add_action('admin_menu', 'remove_menus');
share|improve this question

You can remove this via javascript. The class of the theme informations is versions and the ID of this Meta Box is dashboard_right_now.

The follow screenshot demonstrate how I find this class and id via Crome Webinspector.

enter image description here

    add_action( 'admin_footer-index.php', 'fb_remove_comments_areas' );
    function () {
        <script type="text/javascript">
            jQuery(document).ready( function($) {
                $( '#dashboard_right_now .versions' ).remove();

For more hints to this topic see this plugin, that remove all comments functions and areas.

Also another hints. To remove menu or submenu items it is better, that you use the core functions remove_menu_page() and remove_submenu_page(). Also more information and examples in this post or via search on WPSE. The last one is to use a plugin, there have options for this, like "Adminimize" for reduce the admin area for different roles, not user.

share|improve this answer
This worked perfectly! Thank you so much. – achieve1 Mar 6 '13 at 16:31
Welcome. Please set the check(arrow) to the answer, if the answer was your solution. – bueltge Mar 7 '13 at 11:25

You could use something like below to remove the "Right Now" Widget. Then there would be no way "Theme" to click on.

function custom_dashboard_widgets(){
    global $wp_meta_boxes;
add_action( 'wp_dashboard_setup', 'custom_dashboard_widgets' );
share|improve this answer
Thank you Steve! – achieve1 Mar 6 '13 at 16:30

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.