By using our mini forum, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy

Q: How can I hide username in the dashboard area of WordPress?

+5 votes

How can I hide a particular username (or maybe even admin account) in the WordPress dashboard area;

Here is the screenshot of what I mean:

how to hide username in the admin area of wordpress cms

I DO NOT want the first username to be visible.

Maybe with some code in the functions.php and some Css?

asked in Web Development category by user john7
edited by user golearnweb

1 Answer

+4 votes

Here is the code in 2 parts:

1st part - function with PHP and CSS - to hide the username in the dashboard area with the admin_head hook:

/* Hide username in WordPress dashboard area*/
function hideAdmin() {
    echo '<style>
    .wp-list-table tr[id="user-2"]{ display:none; }

add_action('admin_head', 'hideAdmin');

2nd part - function with PHP and CSS - to hide the number of administrators above:

/*Hide the count of the administrator in the WordPress dashboard area*/
function hide_user_count() {
    echo '<style>
        .wp-admin.users-php span.count {
            display: none;

add_action('admin_head', 'hide_user_count');

Here is a post from where I took part of the code:

answered by user matthew44
edited by user golearnweb