Hide Password Protected WordPress Posts from Search Engines

If you add this code to your header.php file, it will tell Google not to index your password-protected content:

<?php if (!empty($post->post_password)) { ?>
<META NAME="ROBOTS" CONTENT="NOINDEX, FOLLOW">
<?php } ?>

Revisions

There are no revisions for this post.

Tags: , ,

No comments yet.

Leave a Reply