Skip to:
Content
Pages
Categories
Search
Top
Bottom

BuddyPress 2.2.1 incompatible with Yoast SEO, botched page titles


  • Michael
    Participant

    @michaelhpdx

    Hello there fine BuddyPress folks:

    First the context:
    Site: http://www.dalluva.com
    Wordpress 4.1.1
    Buddypress 2.2.1
    bbpress 2.5.4
    Yoast WordPress SEO 1.7.3.1

    Now the issue:

    I just updated to BP 2.2.1 and notice a serious problem with page titles when the Yoast WordPress SEO plugin is enabled. When the SEO plugin is disable, page titles are correct, but when enabled the BuddyPress pages all have the same title, which is the title of the last blog post on the site (!).

    Wordpress SEO only shows this problem on BuddyPress pages (e.g. pages like http://www.dalluva.com/member-area/members/user-name/profile/), and nowhere else (i.e. bbpress pages have correct titles, all other website pages are fine).

    Looks like there’s a major incompatibility between existing WordPress SEO 1.7.3.1 and the recent update to 2.2.1.

    It sounds like at least 1 other person has seen this problem (referenced here: buddypress.org/support/topic/buddypress-2-2-1-is-available-now/). Anyone else? What’s the workaround/fix? Disabling WordPress SEO is not a viable option.

    Many thanks.
    Michael

Viewing 5 replies - 1 through 5 (of 5 total)

  • bp-help
    Participant

    @bphelp


    Michael
    Participant

    @michaelhpdx

    Thanks @bphelp, much appreciated.

    I believe I solved the problem by simply going in and re-saving Permalinks (under Dashboard->Settings->Permalinks). The page titles now look correct.

    Michael


    Michael
    Participant

    @michaelhpdx

    Well, apparently not. The problem is still there, the Permalinks solution only fixed the issue with the broken Sitemaps.

    I’ll go back to evaluating the solution you mentioned, @bphelp.

    Cheers.
    Michael


    megabait12
    Participant

    @megabait12

    Try this one

    
    /**
     * Fix wpseo title
     */
    add_filter('wpseo_title', 'buddypress_wpseo_title');
    
    function buddypress_wpseo_title($title) {
        $wpseo = WPSEO_Frontend::get_instance();
        $separator = $wpseo->options['separator'];
    
        $separator_options = array(
            'sc-dash' => '-',
            'sc-ndash' => '–',
            'sc-mdash' => '—',
            'sc-middot' => '·',
            'sc-bull' => '•',
            'sc-star' => '*',
            'sc-smstar' => '⋆',
            'sc-pipe' => '|',
            'sc-tilde' => '~',
            'sc-laquo' => '«',
            'sc-raquo' => '»',
            'sc-lt' => '<',
            'sc-gt' => '>',
        );
    
        if (array_key_exists($separator, $separator_options)) {
            $separator = $separator_options[$separator];
        }
        $bp = buddypress();
        if (bp_is_user()) {
            $title = bp_get_displayed_user_fullname() . ' | ' . ucfirst($bp->current_component);
        } elseif (bp_is_group()) {
            $title = bp_get_current_group_name() . ' | ' . $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'];
        }
    
        return $title . ' ' . $separator . ' ' . get_bloginfo();
    }
    

    danbp
    Participant

    @danbp

    hi @michaelhpdx,

    maybe these posts will help you ?

    https://buddypress.org/support/topic/my-conditional-tags-are-not-being-respected-in-genesis/
    https://yoast.com/wordpress/plugins/canonical/

    Or maybe this snippet (intended for WP SEO at least) which removes canonical

    function bpfr_wpseo_canonical_exclude( $canonical ) {
      global $bp;
      if ( function_exists( 'buddypress') && ( buddypress()->displayed_user->id || buddypress()->current_component ) ) {
        $canonical = false;
      }
      return $canonical;
    }
    add_filter( 'wpseo_canonical', 'bpfr_wpseo_canonical_exclude' );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘BuddyPress 2.2.1 incompatible with Yoast SEO, botched page titles’ is closed to new replies.
Skip to toolbar