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:

 

14 Comments

  1. thesherps August 16, 2014
  2. gray444 August 22, 2014
  3. hard_zero October 15, 2014
    • Hardeep Asrani October 16, 2014
      • hard_zero October 22, 2014
        • Hardeep Asrani October 22, 2014
  4. michal November 26, 2014
  5. Paulino Michelazzo August 14, 2015
  6. Ken October 29, 2015
  7. Fajar November 29, 2015
  8. reza March 6, 2016

Leave a Reply