Title: noindex
Last modified: July 27, 2018

---

# noindex

 *  Resolved [ptitnux](https://wordpress.org/support/users/ptitnux/)
 * (@ptitnux)
 * [7 years, 11 months ago](https://wordpress.org/support/topic/select-5/)
 * Hello,
    I would want to index only the pages of under menu not pages parents(
   relatives)
 * thank you
    -  This topic was modified 7 years, 11 months ago by [ptitnux](https://wordpress.org/support/users/ptitnux/).

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

 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/select-5/#post-10535168)
 * You can’t do this from settings, you need some code to do this. The function 
   looks something like this, just add your own logic:
 *     ```
       add_filter( 'relevanssi_do_not_index', 'rlv_index_filter', 10, 2 );
       function rlv_index_filter( $block, $post_id ) {
           $block = true;
           if ( post matches your conditions ) {
               $block = false;
           }
           return $block;
       }
       ```
   
 *  Thread Starter [ptitnux](https://wordpress.org/support/users/ptitnux/)
 * (@ptitnux)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/select-5/#post-10535511)
 * Hi Mikko
 * Thank you for your help.
 * where i can found conditions code ? i start with WP code 😉
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/select-5/#post-10538708)
 * You have to formulate your conditions somehow. I can help, if you can tell me
   exactly what the conditions should be – from your initial message, I can’t really
   tell what exactly you want to happen.
 *  Thread Starter [ptitnux](https://wordpress.org/support/users/ptitnux/)
 * (@ptitnux)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/select-5/#post-10546587)
 * I would want to be able to choose pages to index according to their level in 
   breasts of the menu. First level of menu = not indexed and second level of menu
   = indexed.
    Then page contact, legal notices etc. = not indexed
 * Thank you for your patience with me;)
 *  Plugin Author [Mikko Saari](https://wordpress.org/support/users/msaari/)
 * (@msaari)
 * [7 years, 10 months ago](https://wordpress.org/support/topic/select-5/#post-10549641)
 * Probably just easiest to do it like this:
 *     ```
       add_filter( 'relevanssi_do_not_index', 'rlv_index_filter', 10, 2 );
       function rlv_index_filter( $block, $post_id ) {
           $block = false;
           if ( in_array( $post_id, array( 1, 2, 3, 4 ) ) {
               $block = true;
           }
           return $block;
       }
       ```
   
 * and just replace the `1, 2, 3, 4` with a list of page ID numbers for those pages
   you don’t want indexed.
 * Relevanssi Premium would offer you a helpful checkbox on post edit pages you 
   can use to deindex a page, in the free version this is the easiest way to do 
   this.
 *  Thread Starter [ptitnux](https://wordpress.org/support/users/ptitnux/)
 * (@ptitnux)
 * [7 years, 8 months ago](https://wordpress.org/support/topic/select-5/#post-10800481)
 * Thank you very much [@mikko](https://wordpress.org/support/users/mikko/)
    you
   plugin work great !
 * have a nice day

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

The topic ‘noindex’ is closed to new replies.

 * ![](https://ps.w.org/relevanssi/assets/icon-256x256.png?rev=3529670)
 * [Relevanssi - A Better Search](https://wordpress.org/plugins/relevanssi/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/relevanssi/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/relevanssi/)
 * [Active Topics](https://wordpress.org/support/plugin/relevanssi/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/relevanssi/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/relevanssi/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [ptitnux](https://wordpress.org/support/users/ptitnux/)
 * Last activity: [7 years, 8 months ago](https://wordpress.org/support/topic/select-5/#post-10800481)
 * Status: resolved