Title: [Plugin: WordPress.com Stats] Count logged in visitors except admin
Last modified: August 19, 2016

---

# [Plugin: WordPress.com Stats] Count logged in visitors except admin

 *  [madcowz](https://wordpress.org/support/users/madcowz/)
 * (@madcowz)
 * [16 years, 12 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-count-logged-in-visitors-except-admin/)
 * Hi,
 * Using WordPress.com stats and I would like to count the logged in visitors as
   well as those not logged in. But in addition to that, I would like to exclude
   any views by admins.
 * I see that on line 85 of stats.php there is the line:
 * `if ( !empty($current_user->ID) || empty($options['blog_id']) )`
 * which I think controls the logged in and logged out statement.
 * In another section of my blog I am detecting what level of user is logged in 
   using this code:
 *     ```
       <?php if (is_user_logged_in()) { ?>
       		   <?php global $userdata; ?>
       				<?php if ($userdata->user_level>=7) { ?>
       Do A
       <?php } else { ?>
       Else do B
       <?php } ?>
       ```
   
 * and was wondering if I could combine the two, but I don’t think my PHP is quite
   up to that, although I am going to have a go.

Viewing 1 replies (of 1 total)

 *  [icybergie](https://wordpress.org/support/users/icybergie/)
 * (@icybergie)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-count-logged-in-visitors-except-admin/#post-1113426)
 * I wanna know too!

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: WordPress.com Stats] Count logged in visitors except admin’ 
is closed to new replies.

## Tags

 * [Stats](https://wordpress.org/support/topic-tag/stats/)

 * 1 reply
 * 2 participants
 * Last reply from: [icybergie](https://wordpress.org/support/users/icybergie/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-count-logged-in-visitors-except-admin/#post-1113426)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
