wrong index status in backend posts list when using slim_seo_robots_index filter

[ad_1]

Hi,

I am using this code to ONLY index a list of post types:

add_filter( 'slim_seo_robots_index', function( $index ) {
  if ( !is_singular( [ 'page', 'post', 'job' ] ))
    return false;
  return $index;
} );

The problem is that even though index status looks OK in frontend post source code, in backend posts list, all indexes are dispayed as false (red icon).

On the contrary, using the following snippet displays all page indexes as green although I set them to noindex:

add_filter( 'slim_seo_robots_index', function( $index ) {
  if ( is_page() )
    return false;
  return $index;
} );

It seems backend shows the opposite of the status set with the filter.

It is very misleading and made my clients mad and made me lose a lot of time debugging and checking all my indexations on Google 🙁

Hope it can help others.

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer