Forums Forums Search & Filter Pro robots noindex on archive pages

Tagged: , ,

Viewing 6 posts - 11 through 16 (of 16 total)
  • Anonymous
    #204174
    This reply has been marked as private.
    Trevor
    #204183
    This reply has been marked as private.
    Anonymous
    #204185
    add_filter( 'wpseo_robots', 'yoast_seo_robots_remove_search' );
    function yoast_seo_robots_remove_search( $robots ) {
      if ( is_search() || is_404() || is_archive() ) {
        return false;
      } else {
        return $robots;
      }
    }
    Trevor
    #204188

    Thank you. It would be possible to add some conditionality to that code to add noindex if you wanted it WHEN there are search and filter search query strings attached to the bases URL.

    Somehow, Yoast must be detecting that our plugin is working on those pages otherwise.

    Can I mark this thread as resolved for now?

    Anonymous
    #204335
    This reply has been marked as private.
    Trevor
    #204359
    This reply has been marked as private.
Viewing 6 posts - 11 through 16 (of 16 total)