Noindex Password Protected Posts

Need help with this?
Purchase All in One SEO Pack Pro to get dedicated support from us.

Buy Now

In some cases, you may want to noindex password protected posts and pages in All in One SEO Pack. You can use our handy filter aiosp_noindex_password_posts. Simply return true and all password protected posts will be noindex, follow.


Example Usage to noindex ALL password protected posts:

add_filter('aiosp_noindex_password_posts', '__return_true' );


Example Usage to noindex certain password protected posts:

add_filter('aiosp_noindex_password_posts', 'aioseopack_noindex_pw_posts' );

function aioseopack_noindex_pw_posts(){

// Logic here to determine which password-protected posts to noindex. Return true to noindex, and optionally return false to index.
global $post;
if( $post->post_type === 'books' ){
return true; // We will noindex only "books" post type.
return false; // Everything else stays the same as it was.

For instructions on how to use this code, please refer to our FAQ here.

  • Was this helpful ?
  • YesNo
Skip to toolbar