While testing out various features of my 4.7 site, I activated the page Read counter briefly, before deactivating it.

However now the pages which logged a few page views on their Read counters are still displaying their "2 reads" info, even though the option has since been switched off.

How should I go about removing these unused Read counters?

Comments

Stolz’s picture

You can reset counters with a SQL query.

To reset the total counters:
UPDATE `node_counter` set `totalcount` = 0;

To reset day counters:
UPDATE `node_counter` set `daycount` = 0;

To remove the node counter form the bottom right part of the node... I don't know, but if you do, please let me know.

mediafrenzy’s picture

Thanks! I'll try that

mikegb’s picture

How do I make node reads invisible to anonymous visitors?

thanks, Mike

tbites.com

mediafrenzy’s picture

I'm not sure...

For the site I was talking about above, I just ended up removing the entire "links" piece of code I think, but thats a really bad move, because you also lose the other links such as Read More, and whatever else you have running, eg "email this page", "suscribe to post" etc etc

Must be a better way..

mediafrenzy’s picture

Thanks

Also, I think from memory what kinda threw me was that as I was logged in as Admin, it was still displaying Reads data, while in actual fact Guests/Members weren't seeing it! Just in case anyone else is confused ;)

dave reid’s picture

The Statistics Advanced module will have this feature.

gawas.sachin’s picture

go to yoursite.com/admin/user/permissions

You have to set permissions for
" statistics module "

and set all permission to NULL for "view post access counter"

and you are done !

loopduplicate’s picture

If you want to keep the count but don't want to display the reads, you can use hook_link_alter in a custom module to hide the links from everyone including user 1.

/**
   * Implementation of hook_link_alter();
   * Remove the statistics counter
   */
  function mymodule_link_alter(&$links) {
    unset($links['statistics_counter']);
  }
Québec’s picture

Hi,

I tried your solution, but I got a white page after enabling the module. Must of missed something...

I created a «hidecount.info» file containing:

;$Id$

name = hidecount
description = Cacher le compteur de page.
package = Drupal 7 Development
core = 7.x
files[] = hidecount.module

and a «hidecounte.module» with:

<?php
/**
   * Implementation of hook_link_alter();
   * Remove the statistics counter
   */
  function mymodule_link_alter(&$links) {
    unset($links['statistics_counter']);
  }
?>

If you had a few minutes to review my module, that would be appreciated.

R.

tommann’s picture

ul li.statistics_counter {
display:none;
}

nally’s picture

... in your copy/paste from your module, you still have the function named as mymodule_link_alter instead of hidecount_link_alter

Christian Nally - B.C., Canada - http://sticksallison.com

dave.erwin’s picture

for drupal 7 I removed the statistics counter like so:
in template.php

function mytheme_preprocess_node(&$vars) {
	
	//remove the statistics counter from node view
	if(!empty($vars['content']['links']['statistics']['#links']['statistics_counter']['title'])) {
		unset($vars['content']['links']['statistics']['#links']['statistics_counter']['title']);
	}
}