Set all posts to have index and nofollow attributes in All in One SEO

Set all posts to have index and nofollow attributes in All in One SEO on child sites.

Snippet Type

Execute on Child Sites

Snippet

add_filter( 'aioseo_robots_meta', 'aioseo_filter_robots_meta' );

function aioseo_filter_robots_meta( $attributes ) {
   if ( is_singular() ) {
      $attributes['noindex']  = 'index';
      $attributes['nofollow'] = 'nofollow';
   }
   return $attributes;
}