Add Index, Follow in ROBOTS.TXT file using functions.php

Add index and follow meta in robots.txt using functions.php and make your blog post for indexing. You can easily manage this code.

Code –

function thekroyaard_robots( $robots ) {
$robots_index = array(
'index' => true,
'follow' => true,
'max-snippet' => '-1',
'max-image-preview' => 'large',
'max-video-preview' => '-1',
);
return $robots_index;
}
add_filter( 'wp_robots', 'thekroyaard_robots' );

How to Add INDEX, FOLLOW meta tag

  • Open your active theme’s functions.php file.
  • Then paste given code and SAVE file.

Hope this code work perfectly. If you have any other type of help so contact me.