AIOSEO filters

Filters situated here aioseo.com/doc-categories/filter-hooks/

For example, if you need to remove some meta robots tag, you can use this code:

add_filter( 'aioseo_robots_meta', 'aioseo_filter_robots_meta' );

function aioseo_filter_robots_meta( $attributes ) {
   if (  is_product() && str_contains($_SERVER['REQUEST_URI'], 'comment-page')) {
      $attributes['noindex']  = '';
      $attributes['nofollow'] = '';
   }
   if(is_search()){
       unset($attributes['max-image-preview']);
       unset($attributes['max-snippet']);
       unset($attributes['max-video-preview']);
   }
   return $attributes;
}

Добавить комментарий

Ваш адрес email не будет опубликован. Обязательные поля помечены *