• Is there a way to get the isIndexable value of the current post?

    
      $query = new WP_Query($args);
      if ($query->have_posts()) {
        while ($query->have_posts()) {
          $query->the_post();
    
          // bool
          $p_isIndexed = isAIOSEOIndexed(get_the_ID()); 
          
          echo '<a href="{$p_link}">{$p_title}</a> is Indexable? {$p_isIndexed}';
    
        }
      }
    

    – Thanks in adv.

Viewing 1 replies (of 1 total)
  • Plugin Author arnaudbroes

    (@arnaudbroes)

    It’s a little bit more difficult but I believe you can check it this way –

    aioseo()->meta->robots->post( $post );
    
    $meta        = aioseo()->meta->robots->metaHelper( true );
    $isIndexable = empty( $meta['noindex'] )

    You’ll probably want to do a if ( function_exists( 'aioseo' ) ) check first to prevent fatal errors when AIOSEO is disabled.

Viewing 1 replies (of 1 total)
  • The topic ‘Get the robot index value inside a loop’ is closed to new replies.