How To Hide A Specific Admin From User List In WordPress

I was working on a plugin for one of my clients, which required me to hide the admin from the user list in WordPress for some reasons.

I made some Google searches, but found nothing what I really needed. So, I took this code from Stack Overflow and modified it.

Here are a couple of snippets which will hide a specific admin from user list in WordPress for everyone or for everyone but the user itself.

So, this modified snippet will hide your admin user from the list for everyone:

Replace <YOUR USERNAME> in above code with your username. But now who in this world your admin user would itself change its login details?

So, I created this code which will hide your admin user from appearing in the list for everyone, but the user itself:

Replace <YOUR USERNAME> in above code with your username. Problem solved, right? NO!

There is one more small problem. WordPress will still show number of admin users in the top navigation of user list. So, we will just remove the count.

Just add following snippet to your current theme’s functions.php file: