Losing views after updating article

Posted in: Newspaper
Post count: 103

Hello,

Sometimes i need to edit a small thing in my article. After i did and updated it, i notice that all my views are gone and the count starts from 0 again. Super annoying.

How can i solve this?

URL: ttps://www.dagonline.nl

Please advice. Thanks!

  • This topic was modified 8 years by Eric V.
Post count: 20685

Hi,

I have tried editing a post which had 5 views initially, I changed the content, post template, added tags and categories to it. After updating the post and viewing it, the view count was kept, it still had the initial 5 views.
So the previous views should not be lost in your case as well. It seems to count properly from what I can see
https://www.screencast.com/t/Yyy5tK3oOw
https://www.screencast.com/t/F6S0REgu
Views can be seen or modified in the post edit screen
https://www.screencast.com/t/L7MuOTCA4ze

Thanks

Post count: 103

Hey Simion,

No, I’m really losing views sometimes. For sure. Maybe this had something to do with Super Cache plugin?

What about that option Ajax view count option. Does it have something to do with this?

Post count: 20685

Hi,

If you use caching, then the view count may not display accurate results thus explaining the issue. Activate this option in the theme panel (clear all caching after doing this)
https://forum.tagdiv.com/ajax-view-count/
Inspecting your website again the counter seems to work as intended
https://www.screencast.com/t/J3lOBQplG0z
https://www.screencast.com/t/Hjib7klL
Once counted the views should not be lost or modified, they are saved in the database for each post.

Thanks

Post count: 103

Well, it’s already activated Simion. Since the beginning. Should I disable it?

Post count: 20685

Please try to understand that I do not see any problem with the post view counter. Provide a link to a post where the counter is not working and I will inspect it. All the posts I have tested on your website are counting views correctly from what I can see.

That option you mention is to be used if you have caching installed. If you do not have caching then there is no reason to activate it.

Post count: 103

Hello Simion,

Ok, I understand.

I have WP super cache installed and activated. What does the option (ajax view count) do exactly?

Post count: 20685

Then enable it and leave it enabled (if you did not already), there will be no problem. Clear the cache after enabling it. The views will be updated through ajax
https://codex.wordpress.org/AJAX

Post count: 103

Okido. Thank you!

Post count: 82

I have the same issue sometimes and that’s not the cause. I also have WP Super Cache installed and ajax-enabled counter.

In my case, post views count rarely goes back to zero, but it definitely does drop when the post is updated some time later.

The problem is particularly obvious when I keep the post open in admin after publishing it. If I leave and then come back to edit it, less views will drop. Maybe that’s a hint.

Post count: 20685

@menneskedyr The post being opened in the backend would have no effect on the actual published post page views. It will count each time the post was viewed, regardless of post being opened in the editing screen. Please provide a link to your website so we can see if there is a problem with the view counter.

Post count: 82

But there is a custom field “post_views_count”. Sometimes, intermittently, it’s as if this field does not update properly when the post is updated – as if it resets to some previous value. A “hack” would be to note the views count before updating post and then entering the value into this field.

It’s not a life-or-death thing, of course, just a nuisance.

Post count: 103

I just wrote a new article and adjusted a sentence. The view dropt from 110 to 7, from which it started. There is definately an issue. This is the link: https://www.dagonline.nl/suriname/slm-delegatie-reist-af-naar-china-voor-nieuw-toestel/


@menneskedyr
: true, but its kind of annoying when you put time in some writing and the views drop to almost zero again.

Post count: 82

When editing, before you hit the “update” button, reload the post (frontend) in another tab and note the view count. Then enter that number in “post_views_count” custom field and it will be saved.

That should prevent the number from dropping.

Viewing 14 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic.