Created
March 14, 2021 05:12
-
-
Save bahiirwa/299b4cb22408e5d53f72f1691205c1d8 to your computer and use it in GitHub Desktop.
Working with WordPress 5.7 Robots API to add follow
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Remove meta for robots. | |
// remove_filter( 'wp_robots', 'wp_robots_max_image_preview_large' ); | |
// Replace the values in the meta robot tag. | |
add_filter( 'wp_robots', 'techiepress_wp_robots_max_image_preview_large' ); | |
// Remove the image preview and add follow to robots | |
function techiepress_wp_robots_max_image_preview_large( $robots ) { | |
$robots['max-image-preview'] = false; | |
$robots['follow'] = true; | |
var_dump($robots); | |
return $robots; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment