Title: IP
Last modified: September 27, 2017

---

# IP

 *  Resolved [vicetias](https://wordpress.org/support/users/vicetias/)
 * (@vicetias)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/ip-3/)
 * Hello! Just want to know if is there a function to exclude my IP in order to 
   doesn’t count my own views, because a lot of times I need to see my website logged-
   out.

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/ip-3/#post-9535964)
 * Hey there!
 * Try adding this to your theme’s functions.php file:
 *     ```
       function wpp_ip_exclusion( $post_ID, $views ){
   
           $ip_address = $_SERVER['REMOTE_ADDR'];
           $excluded_ip_addresses = array( 'YOUR-IP-ADDRESS-HERE' );
   
           // Visitor has already seen this page
           if ( in_array( $ip_address, $excluded_ip_addresses ) ) {
               exit();
           }
   
       }
       add_action( 'wpp_pre_update_views', 'wpp_ip_exclusion', 10, 2 );
       ```
   
 * Change `YOUR-IP-ADDRESS-HERE` with your actual IP address.
 *  Thread Starter [vicetias](https://wordpress.org/support/users/vicetias/)
 * (@vicetias)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/ip-3/#post-9544260)
 * Worked, thank you.
 * Another question, ‘trending now’ in dashboard shows most viewed posts of the 
   last 24 hours, right? And ‘most viewed’?
    -  This reply was modified 8 years, 8 months ago by [vicetias](https://wordpress.org/support/users/vicetias/).
    -  This reply was modified 8 years, 8 months ago by [vicetias](https://wordpress.org/support/users/vicetias/).
 *  Plugin Author [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/ip-3/#post-9544296)
 * Take a look at [WPP v4 release notes](https://cabrerahector.com/development/wordpress-popular-posts-4-0-is-finally-out/),
   should clear things out.
 *  Thread Starter [vicetias](https://wordpress.org/support/users/vicetias/)
 * (@vicetias)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/ip-3/#post-9545367)
 * I got it, thanks.
 *  Thread Starter [vicetias](https://wordpress.org/support/users/vicetias/)
 * (@vicetias)
 * [8 years, 8 months ago](https://wordpress.org/support/topic/ip-3/#post-9559848)
 * Please [@hcabrera](https://wordpress.org/support/users/hcabrera/), reply to my
   question at “How To: Sort a custom query by views”

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘IP’ is closed to new replies.

 * ![](https://ps.w.org/wordpress-popular-posts/assets/icon-256x256.png?rev=1232659)
 * [WP Popular Posts](https://wordpress.org/plugins/wordpress-popular-posts/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordpress-popular-posts/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordpress-popular-posts/)
 * [Active Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordpress-popular-posts/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordpress-popular-posts/reviews/)

## Tags

 * [address](https://wordpress.org/support/topic-tag/address/)
 * [exclude](https://wordpress.org/support/topic-tag/exclude/)
 * [IP](https://wordpress.org/support/topic-tag/ip/)

 * 5 replies
 * 2 participants
 * Last reply from: [vicetias](https://wordpress.org/support/users/vicetias/)
 * Last activity: [8 years, 8 months ago](https://wordpress.org/support/topic/ip-3/#post-9559848)
 * Status: resolved