// Noindex filter queries
function robotkaldirma() {
return null;
}
if (strpos($_SERVER['REQUEST_URI'], '?') !== false || strpos($_SERVER['REQUEST_URI'], '/feed') !== false) {
add_filter('wpseo_robots', 'robotkaldirma');
add_filter('wpseo_googlebot', 'robotkaldirma');
add_filter('wpseo_bingbot', 'robotkaldirma');
add_filter( 'wpseo_canonical', '__return_false' );
remove_filter('wp_robots', 'wp_robots_max_image_preview_large');
function eklenofollow(){
echo "<meta name='robots' content='noindex, nofollow'>";
}
add_action('wp_head','eklenofollow', 1,1);
}
if you add this code to your function.php file
yoursite.com/subpage?example
or
yoursite.com/subpage/?example
It will return with noindex tag
If you visit a normal page url such as yoursite.com/yourpage
meta robots tag that works like normal
will return.
index, follow how you set on yoast settings
It’s not important. ??
-
This reply was modified 1 year, 6 months ago by emreinci.