Title: [Plugin: WordPress.com Stats] WordPress.com Stats and Logged In Users
Last modified: August 19, 2016

---

# [Plugin: WordPress.com Stats] WordPress.com Stats and Logged In Users

 *  [slshimerdla](https://wordpress.org/support/users/slshimerdla/)
 * (@slshimerdla)
 * [17 years, 8 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-wordpresscom-stats-and-logged-in-users/)
 * Okay… what if I WANT it to show users who are logged in? I don’t see an option
   for this anywhere. Is there a way I can change this via code?
 * I have my blog tied together with my VBulletin forums, and users that are logged
   in on the forums are automatically bridged over to my WP, so a good chunk of 
   my users WILL be logged in. And, of course, I’ll want to count their hits, too.
 * Thanks!

Viewing 7 replies - 1 through 7 (of 7 total)

 *  [spockers](https://wordpress.org/support/users/spockers/)
 * (@spockers)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-wordpresscom-stats-and-logged-in-users/#post-864548)
 * Ditto. My blog is about my 2-yr-old son, and is for family and friends. Everyone
   must register to post, so having only anon users’ stats isn’t very useful. I 
   would think this would be a trivial change, so I’ll see if my limited programming
   skillz are up to it. If I figure it out, I’ll post a solution here.
 * Thanks
 *  [spockers](https://wordpress.org/support/users/spockers/)
 * (@spockers)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-wordpresscom-stats-and-logged-in-users/#post-864549)
 * OK I think I found it. Go to line 85 in stats.php (I’m using CuteFTP, other editors
   may differ on line numbering). It should look like this:
 *  if ( !empty($current_user->ID) || empty($options[‘blog_id’]) )
 * Remove the ! before empty, so it looks like this:
 *  if ( empty($current_user->ID) || empty($options[‘blog_id’]) )
 * So far it seems to be working. Let me know if it works for you.
 *  [jbrinx](https://wordpress.org/support/users/jbrinx/)
 * (@jbrinx)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-wordpresscom-stats-and-logged-in-users/#post-864562)
 * This way you only count the registered users, if you change this line:
 * if ( !empty($current_user->ID) || empty($options[‘blog_id’]) )
 * for this one:
 * if ( empty($options[‘blog_id’]) )
 * it counts everything.
 * Greets,
 * Jbrinx
 *  [spockers](https://wordpress.org/support/users/spockers/)
 * (@spockers)
 * [17 years, 7 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-wordpresscom-stats-and-logged-in-users/#post-864568)
 * Thanks, JBrinx, that makes more sense, and works for me.
 *  [nerdspawn](https://wordpress.org/support/users/nerdspawn/)
 * (@nerdspawn)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-wordpresscom-stats-and-logged-in-users/#post-864574)
 * Thanks for this thread. And thanks for the code change, JBrinx. Made those changes
   now and am super-happy with the stats now, as my site is mainly for registered
   users.
 * One little issue I was wondering if anyone had a solution for…
    Does anyone know
   how to _exclude_ administrator page views from the stats? We’ve got 2 site admins
   and I notice that when I’m adding new content, it includes any of my page views.
   Since I’m using WordPress as a CMS, I’d prefer it not show my own page views 
   to give a more accurate representation of the site traffic.
 * Thanks in advance for any help offered.
 *  [podictionary](https://wordpress.org/support/users/podictionary/)
 * (@podictionary)
 * [17 years, 6 months ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-wordpresscom-stats-and-logged-in-users/#post-864580)
 * I’m running a couple of invitation-only blogs using the “members only” plugin
   so all my visitors are logged in.
 * I could fiddle the code as suggested above but won’t that get washed out every
   time a new version of the stats plugin is updated?
 * I see that the “Google Analyticator” plugin has an option not to count administrators.(
   actually it tracks by “level” admin being 10, I don’t know what the other levels
   are).
 * Here’s a plea to the designers of stats plugin to add similar functionality.
 *  [spockers](https://wordpress.org/support/users/spockers/)
 * (@spockers)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-wordpresscom-stats-and-logged-in-users/#post-864621)
 * @ podictionary…
    Yes, the code change above will get wiped out on updates, I 
   had to hunt this thread again because I got a notice that there’s an update to
   the plugin and I like to stay current. I second your (and NerdSpawn’s) plea about
   the plugin not counting admin users. I’m sure someone out there knows how to 
   do this — it’s surely trivial, so please, someone, jump in!

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘[Plugin: WordPress.com Stats] WordPress.com Stats and Logged In Users’
is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 7 replies
 * 5 participants
 * Last reply from: [spockers](https://wordpress.org/support/users/spockers/)
 * Last activity: [17 years, 1 month ago](https://wordpress.org/support/topic/plugin-wordpresscom-stats-wordpresscom-stats-and-logged-in-users/#post-864621)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
