Noindex & Nofollow Posts

add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { if ( is_singular() ) { $attributes[‘noindex’] = ‘index’; $attributes[‘nofollow’] = ‘nofollow’; } return $attributes; }Continue reading

Noindex Products under a Product Category

add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { if ( has_term( ‘CategoryName’, ‘product_cat’ ) ) { $attributes[‘noindex’] = ‘noindex’; } return $attributes; }Continue reading

Disable SEO Preview feature

add_action( ‘init’, function() { if ( ! function_exists( ‘aioseo’ ) ) { return; } remove_action( ‘wp’, [ aioseo()->standalone->seoPreview, ‘init’ ] ); }, 100);Continue reading

Remove the Canonical URL for a specific URL

add_filter( ‘aioseo_canonical_url’, ‘aioseo_filter_canonical_url’ ); function aioseo_filter_canonical_url( $url ) { if (strpos($url,’/properties/’) !== false) { $url = home_url( $_SERVER[‘REQUEST_URI’] ); } return $url; }Continue reading

Noindex Product Search Pages

add_filter( ‘aioseo_robots_meta’, ‘aioseo_filter_robots_meta’ ); function aioseo_filter_robots_meta( $attributes ) { if ( is_search() && ‘product’ === get_query_var(‘post_type’) ) { $attributes[‘index’] = “noindex”; }; return $attributes; }Continue reading