Created
January 20, 2021 19:57
-
-
Save djrmom/4ece0af74a2a6cdfbcc1af73550e9b27 to your computer and use it in GitHub Desktop.
facetwp yoast seo filter robots
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
<?php | |
/** basic check to modify robots when facets are selected during pre-load **/ | |
add_filter( 'wpseo_robots_array', function( $robots, $class ) { | |
if ( function_exists( 'FWP' ) && !empty( FWP()->ajax->url_vars ) ) { | |
$robots['index'] = 'noindex'; | |
$robots['follow'] = 'nofollow'; | |
} | |
return $robots; | |
}, 10, 2); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment