WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Making WordPress Seo compatible with buddypress (10 posts)

  1. Keshav Saini
    Member
    Posted 2 years ago #

    There is no SEO plugin available that is compatible with buddypress though there are fixes available on some websites that can make WordPress SEO plugin by yoast compatible with buddypress.

    I tried these fixes but I can't get wordpress seo plugin to work with buddypress. I tried to change the title to this one (as suggested by one of website)

    <?php if(!bp_is_blog_page()){ ?>
     <title><?php bp_page_title() ?></title>
    <?php } else { ?>
     <title><?php wp_title(''); ?></title>
    <?php } ?>

    but the buddypress specific top level pages such as Activity, Members and Groups are not rewriting properly. There is double rewriting.

    If I only use <title><?php wp_title(''); ?></title> as recommended by yoast then buddypress specific titles are not rewritten at all.

    Please suggest me some working fix for title rewriting.

    Here is the website

    http://www.environmentabout.com/community

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

  2. Keshav Saini
    Member
    Posted 2 years ago #

    Bump!!

  3. mdpane
    Member
    Posted 2 years ago #

    Yeah, Yoast is a great plugin and I'd be using it over All-In-One-SEA but I've been suffering from the same page title rewriting problems.

    Any fix would be greatly appreciated.

  4. Keshav Saini
    Member
    Posted 2 years ago #

    @mdpane are you using All in one SEO pack with buddypress??

  5. mdpane
    Member
    Posted 2 years ago #

    Currently, yes, and I've had no problems with page titles. But I do prefer how Yoast is designed.

  6. Keshav Saini
    Member
    Posted 2 years ago #

    As far as my experience with Yoast wordpress seo plugin goes, unless your page title isn't <title><?php wp_title(''); ?></title>, you will definitely have problem with rewriting. I even had to drop my earlier development of forum due to this issue.

    I had contacted Yoast in this regards but only got straight answer that nothing can be done for page rewriting issues unless a new version is released addressing the rewrites.

    So I am looking at other options. I don't find current buddypress titles that bad. The only thing I want to do is to add meta descriptions to pages and meta tags to home page only. Rest is fine with buddypress.

  7. walmarandrade
    Member
    Posted 1 year ago #

    Hey, I think I found a solution for this issue at my site (www.mude.nu).

    I am using the most recent versions of Buddypress (1.6.1) and WordPress SEO by Yoast (1.2.8.5).

    It´s not a elegant solution, because I´m not a programmer, but it´s working. I´m sharing to see if I get some improvements.

    So, to make Buddypress titles work while WordPress SEO by Yoast plugin is activated, just add this to your theme´s functions.php:

    <br />
    add_filter('wpseo_title', 'mood_bp_title');<br />
    function mood_bp_title($title) {<br />
    if ( function_exists('bp_current_component') && bp_current_component() ) {<br />
    global $bp;</p>
    <p>  // If this is not a BP page, just return the title produced by WP<br />
      if ( bp_is_blog_page() )<br />
        return $title;</p>
    <p>  // If this is the front page of the site, return WP's title<br />
      if ( is_front_page() || is_home() )<br />
        return $title;</p>
    <p>  $title = '';</p>
    <p>  // Displayed user<br />
      if ( bp_get_displayed_user_fullname() && !is_404() ) {</p>
    <p>    // Get the component's ID to try and get it's name<br />
        $component_id = $component_name = bp_current_component();</p>
    <p>    // Use the actual component name<br />
        if ( !empty( $bp->{$component_id}->name ) ) {<br />
          $component_name = $bp->{$component_id}->name;</p>
    <p>    // Fall back on the component ID (probably same as current_component)<br />
        } elseif ( !empty( $bp->{$component_id}->id ) ) {<br />
          $component_name = $bp->{$component_id}->id;<br />
        }</p>
    <p>    // Construct the page title. 1 = user name, 2 = seperator, 3 = component name<br />
        $title = strip_tags( sprintf( _x( '%1$s %3$s %2$s', 'Construct the page title. 1 = user name, 2 = component name, 3 = seperator', 'buddypress' ), bp_get_displayed_user_fullname(), ucwords( $component_name ), $sep ) );</p>
    <p>  // A single group<br />
      } elseif ( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) && !empty( $bp->bp_options_nav[$bp->groups->current_group->slug] ) ) {<br />
        $subnav = isset( $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] ) ? $bp->bp_options_nav[$bp->groups->current_group->slug][bp_current_action()]['name'] : '';<br />
        // translators: "group name | group nav section name"<br />
        $title = sprintf( __( '%1$s | %2$s', 'buddypress' ), $bp->bp_options_title, $subnav );</p>
    <p>  // A single item from a component other than groups<br />
      } elseif ( bp_is_single_item() ) {<br />
        // translators: "component item name | component nav section name | root component name"<br />
        $title = sprintf( __( '%1$s | %2$s | %3$s', 'buddypress' ), $bp->bp_options_title, $bp->bp_options_nav[bp_current_item()][bp_current_action()]['name'], bp_get_name_from_root_slug( bp_get_root_slug() ) );</p>
    <p>  // An index or directory<br />
      } elseif ( bp_is_directory() ) {<br />
        if ( !bp_current_component() ) {<br />
          $title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() );<br />
        } else {<br />
          $title = sprintf( __( '%s Directory', 'buddypress' ), bp_get_name_from_root_slug() );<br />
        }</p>
    <p>  // Sign up page<br />
      } elseif ( bp_is_register_page() ) {<br />
        $title = __( 'Create an Account', 'buddypress' );</p>
    <p>  // Activation page<br />
      } elseif ( bp_is_activation_page() ) {<br />
        $title = __( 'Activate your Account', 'buddypress' );</p>
    <p>  // Group creation page<br />
      } elseif ( bp_is_group_create() ) {<br />
        $title = __( 'Create a Group', 'buddypress' );</p>
    <p>  // Blog creation page<br />
      } elseif ( bp_is_create_blog() ) {<br />
        $title = __( 'Create a Site', 'buddypress' );<br />
      }</p>
    <p>  // Some BP nav items contain item counts. Remove them<br />
      $title = preg_replace( '|<span>[0-9]+</span>|', '', $title ); }</p>
    <p>  return apply_filters( 'bp_modify_page_title', $title . ' ' . $sep . ' ', $title, $sep, $seplocation );<br />
    }<br />

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code has been permanently damaged/corrupted by the forum's parser.]

  8. ricardofpraimundo
    Member
    Posted 1 year ago #

    What this code does is basically change the titles, in short, disable functions that were given to the plugin. I see that almost everyone reverts to the original titles.

    I'm also having problems with this plugin, but my problem is that only one, is to have your user name appear in the title, your name does not appear with the plugin active.

    Does anyone know how to solve this problem?

  9. alen9788
    Member
    Posted 1 year ago #

    @Keshav
    Did you solve the problem,i didn't find a proper seo plugin for buddypress.
    Just Greg's High Performance SEO can be show the title and keywords,and this plugin is compatible with bbpress.
    And i wanted to use seopress plugin to make up the description show,but failed,SEOPRESS doesn't work at all.
    what should i do?

  10. Keshav Saini
    Member
    Posted 1 year ago #

    @alen9788

    I used SEO ultimate plugin in the end but I stopped working on my buddypress site so don't exactly remember if it all solved my issues but it was certainly better than SEO plugin by Yoast.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic