Hi. How do I get visits from the bots not contain my "recently viewed posts"?
Every time my posts are being visiteds, but by bots..
Since the plugin dont count admin's visists, I think that this is possible..
Hi. How do I get visits from the bots not contain my "recently viewed posts"?
Every time my posts are being visiteds, but by bots..
Since the plugin dont count admin's visists, I think that this is possible..
Hi, thanks for checking out my plugin!
Create a handler for the recently_viewed_posts_new filter in your theme's functions.php that will return NULL on the bots' visits. For example,
add_filter("recently_viewed_posts_new", "my_rvp_ignore_bot_visits");
function my_rvp_ignore_bot_visits( $item ) {
$bots = 'Google|msnbot|Rambler|Yahoo|AbachoBOT|accoona|' .
'AcioRobot|ASPSeek|CocoCrawler|Dumbot|FAST-WebCrawler|' .
'GeonaBot|Gigabot|Lycos|MSRBOT|Scooter|AltaVista|IDBot|' .
'eStyle|Scrubby';
return (preg_match("/$bots/", $_SERVER['HTTP_USER_AGENT']) > 0) ? null : $item;
}
The code is from Jay Paroline http://wanderr.com/jay/detect-crawlers-with-php-faster/2009/04/08/ . I hope this helps.
This really helped me.
Thanks!
This topic has been closed to new replies.