Almost 11 years ago, we published an article on how to disable hit tracking in Joomla. The process explained in that old article worked for Joomla 1.5, 1.6, 1.7, 2.5 and 3 (it didn’t work for Joomla 1.0 because the code in Joomla 1.0 was more of a spaghetti code than real code).
The solution described in our old post consisted of a core modification – which is something that we love to do (for some reason), but it is also something that should be avoided when possible. Joomla 4 and 5 have a new option that allows you to disable article/category hit tracking from within the CMS (without any core modification), here’s how:
- Login to your Joomla website.
-
Click on Content -> Articles on the left menu.
-
Click on Options on the top.
-
Click on the Articles tab (this should already be clicked by default).
-
Scroll down below, and change the value of “Record Hits” to “No”.
-
Save & Close the configuration settings for the articles.
-
That’s it! You’ve now disabled article hit tracking on your Joomla website. Not only that, you’ve disabled hit tracking on the categories as well – as both the articles and the categories share the same setting.
As you can see above, the solution is simple and straightforward, but, if you like to do it in the core itself (one reason to do it from the core is that the mod_articles_popular module will not work if the “Record Hits” configuration setting is set to “No”), then here’s how to do it:
- Open the file ArticleModel.php file under the components/com_content/src/Model folder of your Joomla website.
-
Add the following line at the very beginning of the function hit:
return true;
-
Save the file and upload it back. Note that if you want to also disable hit tracking for categories, you will need to make the exact modifications to the CategoryModel that is located in the same folder.
So, what is hit tracking anyway?
Hit tracking consists of incrementing the views of an article – so, if Joomla says that an article has 31 hits, this means that the article has been viewed 31 times.
Why would anyone want to disable hit tracking?
Hit tracking is a very useful feature, and it is used in several Joomla modules/features, such as the mod_articles_popular module that is used to display the most viewed articles. That’s the bright side of things, the other side of things though is that this feature is heavy – very heavy especially on large Joomla websites (e.g. news websites) as it modifies/locks the #__content table for every page view. If left unchecked, this feature can crash a large Joomla website during peak traffic hours. So, an alternative method to record the views must be used – for example, on very active/large Joomla websites, we send a hit request about 5% of the time.
Is hit tracking only available on Joomla content items (e.g. articles/categories)?
No, it is also available on contacts items (contacts and categories), newsfeed items (newsfeed and categories), and tags. Hit tracking on each of these items can be disabled from the Options of the respective component.
We hope someone, somewhere found this post useful. If you need help with the implementation or if you need any advice, then please contact us (our fees will apply).