Support » Plugin: Relevanssi - A Better Search » Stop indexing "Private" pages?

Viewing 3 replies - 1 through 3 (of 3 total)
  • I now see that it’s a feature in the Premium plug-in version. Ah, well…

    Plugin Author Mikko Saari

    (@msaari)

    Relevanssi indexes private pages, both in free and Premium version. If you wish to avoid indexing private pages, you can use the ‘relevanssi_do_not_index’ filter, like this:

    add_filter('relevanssi_do_not_index', 'do_not_index_privates', 10, 2);
    function do_not_index_privates($index, $post_id) {
        if (get_post_status($post_id) == 'private') $index = false;
        return $index;
    }
    Plugin Author Mikko Saari

    (@msaari)

    Because somebody asked: The code can go anywhere that gets executed, but the typical place for something like this is in your theme functions.php file.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Stop indexing "Private" pages?’ is closed to new replies.