Drupal: .htaccess Access Deny
August 21, 2014 – 7:59 am | No Comment

In this article I will tell how to forbid access to certain resources for some clients. The instructions will include descriptions of different directives.

Read the full story »
CSS Templates

Contain reviews and news about CSS Templates.

Freebies

Contain freebies such as icons, graphics, headers and images for your websites.

Fun Stuff

Contains other fun stuff for entertainment or interesting site showcase.

How-To

Contain technical elaborations on some specific workarounds or common tweak.

Joomla Templates

Contains reviews and news about Joomla templates.

Home » How-To

Drupal: How to Remove Node Statistics Counter

Submitted by on May 26, 2011 – 8:03 amOne Comment

If Statistics module is enabled on your site, a number of views is shown for every node. In this article we will study how to hide this information.

Options:

1. Remove Statistics module

You should keep in mind that the following logs will be inaccessible without Statistics module:

  • Visitor sources
  • Last visits
  • Popular pages
  • Active visitors
  • Access log settings

2. Hide counter with the help of CSS

The following CSS rule will hide information about views number. But  the information will be generated & calculated:

li.statistics_counter {display: none; }

3. Disable access to this information

  • Open “Access control” page;
  • Find “statistics” module here;
  • Disable “enable access to the statistics” and “view message counter” for the appropriate roles.

Nevertheless, site administrator will be able to view the counter.

4. Очистить переменную в массиве $links

Statistics output is codes in $links array. Insert this code before the first $links output in your template:

unset($links[‘statistics_counter’]);

5. Disable calculating of views number

  • Open logs settings (admin/logs/settings)
  • Set “Disabled” for “Content views counter”

Good luck!

One Comment »

  • Peter says:

    Please, can you translate step 4:

    Очистить переменную в массиве $links

    I also have a question… i want only to remove or hide the counter from the page content type. How to do this?

    Thanks,

Leave a comment!

Add your comment below, or trackback from your own site. You can also subscribe to these comments via RSS.

Be nice. Keep it clean. Stay on topic. No spam.

You can use these tags:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

This is a Gravatar-enabled weblog. To get your own globally-recognized-avatar, please register at Gravatar.