Home / Admin / Add Noindex & Nofollow Attributes to all the Posts
Duplicate Snippet

Embed Snippet on Your Site

Add Noindex & Nofollow Attributes to all the Posts

This filter can be used to add Noindex & Nofollow attributes to all the Posts

70+
Code Preview
php
<?php
add_filter( 'aioseo_robots_meta', 'aioseo_filter_robots_meta' );
function aioseo_filter_robots_meta( $attributes ) {
   if ( is_singular() ) {
      $attributes['noindex']  = 'noindex';
      $attributes['nofollow'] = 'nofollow';
   }
   return $attributes;
}

Comments

Add a Comment