Title: Exclude Specific Page
Last modified: July 31, 2019

---

# Exclude Specific Page

 *  Resolved [vinayakboga8](https://wordpress.org/support/users/vinayakboga8/)
 * (@vinayakboga8)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/exclude-specific-page-3/)
 * Hi,
 * Great Plugin!
 * The only thing i need is the exclude a specific page. Please Help.
 * Thanks!

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

 *  [Daniel Hendricks](https://wordpress.org/support/users/hendridm/)
 * (@hendridm)
 * [6 years, 8 months ago](https://wordpress.org/support/topic/exclude-specific-page-3/#post-11909974)
 * This is [specifically answered](https://wordpress.org/plugins/restricted-site-access/#how%20do%20i%20allow%20access%20to%20specific%20pages%20or%20parts%20of%20my%20site%3F)
   in the FAQ.
 *     ```
       add_filter( 'restricted_site_access_is_restricted', 'my_rsa_feed_override’, 10, 2 );
   
       function my_rsa_feed_override( $is_restricted, $wp ) {
           // check query variables to see if this is the feed
           if ( ! empty( $wp->query_vars['feed'] ) ) {
               $is_restricted = false;
           }
           return $is_restricted;
       }
       ```
   
 * You can use something like [get_post()](https://developer.wordpress.org/reference/functions/get_post/)
   to get the current post, and add logic like “if the page ID equals” or “if the
   post_name is,” etc. If you just want to blacklist a certain page, you can use
   [get_the_ID()](https://developer.wordpress.org/reference/functions/get_the_ID/).
 *  [RenaiSens](https://wordpress.org/support/users/renaisens/)
 * (@renaisens)
 * [6 years, 7 months ago](https://wordpress.org/support/topic/exclude-specific-page-3/#post-12035211)
 * Hi [@hendridm](https://wordpress.org/support/users/hendridm/)
 * Thanks for this reply.
 * Could you write the code we must add to exclude specific pages, please ?
    I’m
   not a specialist.
 * And where must I add this code ?
    Into the function.php file ?
 * Thanks for your help
    Regards Ludovic
 *  [RenaiSens](https://wordpress.org/support/users/renaisens/)
 * (@renaisens)
 * [6 years, 6 months ago](https://wordpress.org/support/topic/exclude-specific-page-3/#post-12043213)
 * Hi [@vinayakboga8](https://wordpress.org/support/users/vinayakboga8/)
 * You have the same request like me.
    I’m not a specialist.
 * Could you give me the code you finally use to exclude a specific page ?
 * BIG Thanks
    Regards Ludovic
 *  [willdries](https://wordpress.org/support/users/willdries/)
 * (@willdries)
 * [6 years, 5 months ago](https://wordpress.org/support/topic/exclude-specific-page-3/#post-12205210)
 * Hi [@renaisens](https://wordpress.org/support/users/renaisens/) and [@vinayakboga8](https://wordpress.org/support/users/vinayakboga8/),
 * Maybe this can help you:
 *     ```
       add_filter( 'restricted_site_access_is_restricted', 'exclude_page_from_restriced_access', 10, 2 );
   
       function exclude_page_from_restriced_access( $is_restricted, $wp ) {
       	$url = 'https://' . $_SERVER[ 'HTTP_HOST' ] . $_SERVER[ 'REQUEST_URI' ];
       	$current_post_id = url_to_postid( $url );
           if ( $current_post_id  == '644' ) {
               $is_restricted = false;
           }
           return $is_restricted;
       }
       ```
   
 * In my case I had to exclude a page with ID 644. You have to put this code in 
   functions.php. It maybe is a quick and dirty solution, but it works for me.
 * Regards Will

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

The topic ‘Exclude Specific Page’ is closed to new replies.

 * ![](https://ps.w.org/restricted-site-access/assets/icon-256x256.png?rev=2675243)
 * [Restricted Site Access](https://wordpress.org/plugins/restricted-site-access/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restricted-site-access/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restricted-site-access/)
 * [Active Topics](https://wordpress.org/support/plugin/restricted-site-access/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restricted-site-access/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restricted-site-access/reviews/)

 * 4 replies
 * 1 participant
 * Last reply from: [willdries](https://wordpress.org/support/users/willdries/)
 * Last activity: [6 years, 5 months ago](https://wordpress.org/support/topic/exclude-specific-page-3/#post-12205210)
 * Status: resolved