Set user pages to noindex,follow

3.20K viewsCore
0

Hi Rahul,

one last question: is it possible to set the user pages example.com/questions/user/… to “noindex,follow” in the head-area?

I don’t want these pages in google’s index and google itself recommends besides the use of robots.txt to set meta name robots to noindex to prevent from indexing.

Maybe with a if-condition in my themes header.php?

I do similiar for WordPress pagination and search results:

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

Kind regards,
Manuel