Community Documentation

Reset all nodes read counts to zero

Last updated January 12, 2010. Created by stuckagain on January 12, 2010.
Edited by VM. Log in to edit this page.

This snippet resets the node read count to zero.

UPDATE `node_counter` SET `totalcount` = '0'

Of course if your database tables have a prefix, you will need to change the snippet along the following lines ...

UPDATE `drupal_node_counter` SET `totalcount` = '0'

This is useful if you need to clear node read statistics during the development phase of a website and want a zero count at launch the the rest of the world.

For those who aren't savvy in MySQL, one can also disable and uninstall the statistics.module and reinstall statistics.module to reset counts to 0.

Reference

Drupal’s online documentation is © 2000-2013 by the individual contributors and can be used in accordance with the Creative Commons License, Attribution-ShareAlike 2.0. PHP code is distributed under the GNU General Public License. Comments on documentation pages are used to improve content and then deleted.
nobody click here