Support » Plugins and Hacks » [Plugin: Recently Viewed Posts] How can I remove the visists counter of bots?

Viewing 2 replies - 1 through 2 (of 2 total)
  • 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!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Recently Viewed Posts] How can I remove the visists counter of bots?’ is closed to new replies.