Grow your CSS skills. Land your dream job.

Last updated on:

Prevent Search Bots from Indexing Search Results

In the <head> section of your header.php file:

<?php if(is_search()) { ?>
   <meta name="robots" content="noindex, nofollow" /> 
<?php }?>

Comments

  1. This piece of code seems to be very useful. I never thought about this before, but yes, I definitely don’t want my search results page to be followed by robots.

Leave a Comment

Current day month ye@r *

*May or may not contain any actual "CSS" or "Tricks".