WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Yoast + BuddyPress = All forum posts and members share a canonical tag (5 posts)

  1. indietravel
    Member
    Posted 1 year ago #

    Setup: Latest WP (3.5.1) + BuddyPress + Yoast's WordPress SEO plugin + Woothemes.

    The issue: The cannonical URLs of almost all BP pages are showing as the 'home' URL for that function, for example:
    domain.com/members/ and
    domain.com/members/admin/
    both show the cannonical URL domain.com/members/

    The same goes for domain.com/groups ... every single group, forum, topic, subpage ALL show the cannonical link as domain.com/groups or /members, etc.

    for example: indietravelpodcast.com/groups/oceania-travel/forum/topic/van-recommendations-for-australia/

    Shows:

    <!-- This site is optimized with the Yoast WordPress SEO plugin v1.3.4.4 - http://yoast.com/wordpress/seo/ -->
    <!-- Admin only notice: this page doesn't show a meta description because it doesn't have one, either write it for this page specifically or go into the SEO -> Titles menu and set up a template. -->
    <link rel="canonical" href="http://indietravelpodcast.com/groups/" />
    <meta name="robots" content="noodp,noydir"/>
    <link rel="author" href="https://plus.google.com/108416784493266670455/"/>
    <meta name="twitter:card" content="summary">
    <meta name="twitter:site" content="@indietravel">
    <meta name="twitter:description" content="">
    <meta name="twitter:title" content="Groups | Indie Travel Podcast">
    <meta name="twitter:url" content="http://indietravelpodcast.com/groups/">
    <!-- / Yoast WordPress SEO plugin. -->

    My header reads:

    <!-- titles updated for BP/Yoast compatibility -->
    <?php if(!bp_is_blog_page() ){ ?>
    	 <title><?php bp_page_title() ?></title>
    <?php } else { ?>
    	<title><?php woo_title( '' ); ?></title>
    <?php } ?>

    But the !bp_is_blog_page isn't doing anything helpful here, as some other forum commenters claimed it might.

    This is obviously a major issue for search and for machine-readability in general. What's the deal, and what's the fix?

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

  2. Martin
    Member
    Posted 1 year ago #

    Did you manage to find a solution to this at all?

  3. sevelina
    Member
    Posted 1 year ago #

    I've got the same problem. Did you resolved it?

  4. sevelina
    Member
    Posted 1 year ago #

    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/

  5. Nykess
    Member
    Posted 11 months ago #

    This is nice, but it completely strips the canonical URL. Can it be modified to include each individual member's username in the canonical URL?

    This also strips the og tag of a URL.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic