Home / Admin / Untitled Snippet
Duplicate Snippet

Embed Snippet on Your Site

Untitled Snippet

Code Preview
php
<?php
add_filter( 'aioseo_robots_meta', 'aioseo_filter_robots_meta' );
function aioseo_filter_robots_meta( $attributes ) {
	$url = home_url( $_SERVER['REQUEST_URI'] );
	if (strpos($url,'product_search=') !== false) {
		$attributes['index'] = "noindex";
	};
	return $attributes;
}

Comments

Add a Comment