Quantcast
Channel: WordPress.org Forums » [Yoast SEO] Support
Viewing all articles
Browse latest Browse all 41907

roundaboutmv on "[Plugin: WordPress SEO by Yoast] How to exclude canonical URL on two pages?"

$
0
0

We have a bunch of dynamic URLs (they are real estate property listings) that are not being indexed by Google because of the canonical. From this forum I found out how to exclude it on the "Rentals" page but what is the correct syntax to exclude it from a second page? In this case, the "Sales" page?

I'm assuming there's might be "array" involved, but so far everything I've tried has broken it. Here's the original code -

of function wpseo_canonical_exclude( $canonical ) {
global $post;
if ( $post->ID == xxx) {
$canonical = false;
}
return $canonical;
}
add_filter( 'wpseo_canonical', 'wpseo_canonical_exclude' );

http://wordpress.org/extend/plugins/wordpress-seo/


Viewing all articles
Browse latest Browse all 41907

Trending Articles