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

sevelina on "[Plugin: WordPress SEO by Yoast] Yoast + BuddyPress = All forum posts and members share a canonical tag"

$
0
0

YES! I found how to fix it! :)
You need add this to your theme function.php:

function wpseo_canonical_exclude( $canonical )
{
		global $bp;
		if ( $bp->current_component)
                {
   		$canonical = false;
                 }
	return $canonical;
}
add_filter( 'wpseo_canonical', 'wpseo_canonical_exclude' );

Maybe it's not really nice solution, but it works, members, groups and forums will not share a canonical slug anymore.
I'm using this at my website http://sevelina.ru/


Viewing all articles
Browse latest Browse all 41911

Trending Articles