Loading...
Joomla 2.5Joomla Tutorials

Joomla 2.5 – How to Reset Article Hits Counter

Joomla 2.5 - Reset Article Hit Counter
Joomla 2.5 - Reset Article Hit Counter

Joomla 2.5 Tutorial – In recent versions of Joomla they removed the functionality to reset the Article Hits Counter.  This was a very useful feature because during the testing phase of your site, you probably opened the article a million times.  But now that your site is going into production, you want an accurate count of how many times your article was viewed.

Sorry to say, there is no easy way to reset the Article Hits Counter.  You will have to access your database with phpMyAdmin and reset your Article counter using SQL or edit the values in the table.  Below I will show you how to do this.

Joomla 2.5 - Content Article Manager
1. Joomla 2.5 - Content Article Manager

Overview of how to reset the article counter:

  • Find Article ID in the Article Manager
  • Access your Database from phpMyAdmin
  • Locate the “Article” table
  • Change the Article Hit Count – Basic or
  • Change the Article Hit Count – Advanced

More detailed steps:

1.  Find Article ID in the Article Manager

Joomla 2.5 - Find the Article ID in Article Manager
1. Joomla 2.5 - Find the Article ID in Article Manager

Every article that you save in your Joomla 2.5 website has a unique ID number.  So you must find this number in your Article Manager.   If you want to reset all your article hit counters, I will also show you how to do that below.  This step is if you want to reset the hit counter for 1 article.

  • Login to your Joomla 2.5 Administrator backend
  • Click on ‘Content’, ‘Article Manager
  • Under ‘Article Manager: Articles’, find your Article and look at the far right column under ‘ID’.
  • You will find the Article ID number.  For example:
    • I want to reset ‘Administrator Components‘ article, Article ID=1
  • Save this information for Step 4

2.  Access your Database from phpMyAdmin

  • Joomla 2.5 - Click on your Database Name in phpMyAdmin
    2. Joomla 2.5 - Click on your Database Name in phpMyAdmin
  • Login to your phpMyAdmin
  • Click on your Database to open up all the tables on the left navigation

3.  Locate the “Article” table

Joomla 2.5 - Click on content table
3. Joomla 2.5 - Click on content table
  • Scroll down to find the table name _content
    • Each table name is prefixed with some letters/numbers.  This is different for everyone, but what remains the same is the table name.
  • Click on the table name  _content

4.  Change the Article Hit Count – Basic

There are 2 ways to reset the Article Hit Counter and step 4 is the Easiest (Basic) way.

Joomla 2.5 - phpMyAdmin Edit Article Row
4. Joomla 2.5 - phpMyAdmin Edit Article Row
  • In the table, find the Article you want to reset.
    • For example: I searched for article title ‘Administrator Components
  • Confirm the Article ID number is the same as in Step 1
  • Click on the ‘pencil’ icon (2nd column) to edit the record in the _content table
  • Scroll down to ‘Hits’, and set the following value:
    • Hits = 0
  • Click on ‘GO’
Joomla 2.5 - Reset Article Hit Counter in phpMyAdmin
4. Joomla 2.5 - Reset Article Hit Counter in phpMyAdmin

5.  Change the Article Hit Count – Advanced

This is the more advanced way where you will use SQL to mass reset all articles hit counter.  This step is reserved for those who are experienced with SQL.  If you are not an expert, be careful when using this query changes you make might affect the all database data.

Note for the queries below, you must replace the code in italics with database information of your own.

This query will reset all Article hit counters to 0

  • UPDATE `YourDatabasename`.`PREFIX_content` SET `hits` = ‘0’

This query will reset Article hit counter for one article.  For example ID = 1

  • UPDATE `YourDatabasename`.`PREFIX_content` SET `hits` = ‘0’ WHERE `PREFIX_content`.`id` =1;

After you run the SQL you can refresh your Joomla 2.5 website and you will see your Article hit counter set back to zero.

Hope that helps.  Let me know if you have any further questions.

Thanks,

Elaine

One comment
Leave a Reply

Your email address will not be published. Required fields are marked *

Captcha Captcha Reload