Reset Post View Counter

Posted in: Newspaper
Post count: 3

Hello,
I would like to reset the post view counter for all posts, in order to have the popular posts widget reset as well.
Can you tell me where I can reset it? I would assume it’s stored in the database?
Thank you!

Post count: 35449

Hi,

The most save way it will be to change the view manually, unfortunately this need to be don on each post manually -> https://i.imgur.com/AHnccHI.png making changes in database can be quite risky.

Thank you!

Post count: 3

We have 1000 posts on our site, I don’t think that we will be doing it manually,
can you please tell me where it is stored in the database? Which table etc. ?
Or is there a function that can be called and modified in order to reset all post view counters ?
Thank you

Post count: 35449

Hi,

There is no indicate to do this in database, however I manage to make a function that can help you, you can get it from here -> https://pastebin.com/VX9Nd7zT , you need to set it in wp-content/plugins/td-composer/legacy/Newspaper/functions.php like this -> https://i.imgur.com/ZNMViNG.png after that refresh your posts and check if the view counter are set on each posts after that remove the code from function ( if not the view counter will be overwrite with 0).

Hope this will help you!
Thank you!

Post count: 3

Thank you so much! Worked like a charm 🙂

Viewing 5 posts - 1 through 5 (of 5 total)
The forum ‘Newspaper’ is closed to new topics and replies.