1

I want to run an update script on pages that haven't been viewed and updated within X days. I'm using post meta to cache some related RSS feed data, and I want it updated once a week or two, but only if the page has actually been viewed within the last two or three weeks, bots included.

Is there an internal counter or whatnot that has this data, or am I going to have to build something that stores the UNIX timestamp as post meta upon page view?

0

Post views log/count is not available natively. It is resource-intensive (database writes are much more expensive than reads) and won't work (if done in pure PHP) with most caching plugins.

There is number of plugins/services that offers Analytics via JS- or image-based tracking. Your best bet is to let such service handle analytics and pull data from there.

1

Most webservers have a so called logfile. When your site makes use of effective canonical permalinks, you can gain that information from the request URIs stored in the access-log-files.

This can be run as a janitor job in the background once a day/week while querying the URIs against your site's permalink structure and a genereate superset of all URIs as a hash-table to post IDs.

  • This would work, but it would be next to impossible to generalize a plugin to do something like this. Cool idea though. – Dan Gayle Oct 15 '10 at 22:52
  • Yeah this is specific to the installation. I think you need something weighted anyway because crawlers will visit any page once. – hakre Oct 15 '10 at 22:56

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.