Making BuddyPress compatible with the WordPress SEO plugin from Yoast

wordpress_seo_buddypress

The WordPress SEO plugin from Yoast is pretty much the only SEO solution you need for your WordPress site. It has become a default plugin in all my WordPress and BuddyPress projects. The only issue is that the plugin hooks into the common wp_title template tag to rewrite your site URLs to a custom title (that you specify from the WordPress SEO settings). BuddyPress does not use this tag, and thus the URL rewriting does not work. Below is a quick snippet that will fix this problem for you.

Find the following code in header.php of your Child Theme (around line 9):

<?php bp_page_title() ?>

And replace it with the following snippet:


 <?php bp_page_title() ?>

 <?php wp_title('') ?>

WordPress SEO is now working as it should. Enjoy!

BuddyPress Hosting Guide Looking for quality BuddyPress hosting? We will guide you through all the available hosting options and help you find the best webhost for your next BuddyPress project!

Something about bowe

BuddyPress fanatic, WordPress Theme designer and MultiSite community builder. Proud co-founder of PressCrew. Loves to use awesome in every sentence. Often described as a Dutch Treehugging Hippie.

31 Responses to Making BuddyPress compatible with the WordPress SEO plugin from Yoast

  1. Amisharma132 April 5, 2011 at 7:42 pm #

    gd information…….

    Reply
    • Bowe Frankema April 5, 2011 at 11:10 pm #

      Glad you found it useful!

      Reply
  2. JoSe May 12, 2011 at 8:30 pm #

    I am using a BP child of theme hybrid framework. At header.php shows

    Should I replace “” with “” in the code above ?

    Thanx

    Reply
  3. JoSe May 12, 2011 at 8:31 pm #

    Reply
  4. JoSe May 12, 2011 at 8:31 pm #

    Now, how do I paste code in here ?

    Reply
  5. Rahul May 21, 2011 at 6:36 pm #

    A very good list. I really like the list as I am always searching for additional plugins to make my site more effective.

    thank you for this valuable info..

    Reply
    • bowe May 22, 2011 at 8:24 pm #

      You’re welcome :)

      Reply
  6. Neo May 23, 2011 at 1:20 pm #

    Thanks!
    Personaly, i use SeoPress in my web site.

    Reply
  7. Greg Fielding June 8, 2011 at 11:02 pm #

    Bowe,

    Is there a way to add specific sitemap support for the buddypress activity stream? For my site, the activity stream, and member’s profile pages should be my highest priorities. However, with yoast seo and this snip, neither show in any of the sitemaps.

    Reply
  8. Aaron July 18, 2011 at 4:24 am #

    Thanks for the quick fix! Yoast is the man and glad you found a buddypress workaround for his SEO plugin.

    Reply
  9. Kevin July 25, 2011 at 2:43 pm #

    It’s not working for the activity stream:
    Submitted URLs
    23,522
    967 URLs in web index

    URLs not followed
    When we tested a sample of URLs from your Sitemap, we found that some URLs redirect to other locations. We recommend that your Sitemap contain URLs that point to the final destination (the redirect target) instead of redirecting to another URL.

    Is there any way to fix this?

    Reply
  10. Laurent July 26, 2011 at 8:20 pm #

    Thanks for the trick ! I just migrate from All In One SEO to Yoast Wordrpress and as I’m using BuddyPress I’m very happy ;-)

    Reply
  11. Ronald September 2, 2011 at 9:15 am #

    Great, just what I needed!!
    Thx!!

    Reply
  12. Herb Miller October 27, 2011 at 4:51 pm #

    I had a similar problem with themes generated using Artisteer. My solution was to write a function called bw_wp_title(). This works out what to do depending on whether or not WordPress SEO is activated.

    /**
    * return a nice SEO title
    * taking into account which plugins are being used
    */
    if ( !function_exists( ‘bw_wp_title’ )) {
    function bw_wp_title() {
    if ( class_exists( ‘WPSEO_Frontend’ )) {
    $title = wp_title(”, false );
    }else {
    $title = wp_title( ‘|’, false, ‘right’ );
    $title .= get_bloginfo( ‘name’ );
    }
    return $title;
    }
    }

    I included this in functions.php for the ( child ) theme. I then changed header.php to echo the result of bw_wp_title(), commenting out the original code.
    Note: The bw_wp_title function is wrapped in “if not function exists” so that I can implement the same or better version of this function in my oik plugin.

    Reply
  13. Wiloooo November 9, 2011 at 9:37 pm #

    GREAT ! thank’s you ;)

    Reply
  14. Plugín de Suscriptores para WordPres February 6, 2012 at 9:05 am #

    Wow, awesome blog format! How long have you been blogging for? you made blogging glance easy. The entire look of your web site is wonderful, as smartly as the content material!

    Reply
  15. Keshav Saini February 29, 2012 at 4:27 pm #

    This fix isn’t working for my site http://www.environmentabout.com/community

    When I change I code in header, all the pages works perfectly but Activity, Groups and Members pages. These pages are mixing up the titles.

    How do I prevent buddypress specific pages from being rewritten by this plugin?

    Reply
  16. April 16, 2012 at 6:54 am #

    Ola! Bowe,
    This might be off topic, however WordPress SEO is not difficult provided a simple process is followed. When considering WordPress SEO a few common questions are:
    Great Job!

    Reply
    • May 30, 2012 at 11:53 am #

      Good day! I simply would like to give an emrnoous thumbs up for the great info you will have right here on this post. I will likely be coming again to your weblog for extra soon.

      Reply
  17. social May 5, 2012 at 4:48 am #

    If you could email me with some hints & tips about how you made this blog look this good , I would appreciate it!

    Reply
    • June 1, 2012 at 12:51 am #

      Bonjour, This blog is very interesting and fun to read. I am a enouumors follower of the topics blogged about. I also love reading the replies, but it seems like that most of people need to stay on topic to try and give more to the original topic. I would also encourage all of you to add this website to your favourite website to help get the word out. Warm Regards

      Reply
  18. reddit May 5, 2012 at 4:49 am #

    An cool blog post right there mate . Thank you for that !

    Reply
  19. click here May 5, 2012 at 4:49 am #

    I have got one suggestion for your webpage. It looks like there are a couple of cascading stylesheet problems when opening a selection of webpages in google chrome and internet explorer. It is operating fine in internet explorer. Possibly you can double check this.

    Reply
    • June 1, 2012 at 5:20 am #

      May 8, 2012Currently I am wiorkng on Buddypress User Account Type PRO, just after that I’ll start wiorkng on this.so, it may take 3.5 more weeks to release it.hmm.. about multiple user community, it is not hard to do with Buddypress. basically, buddypress is built to do that. it doesn’t remove any wordpres feature, just extend it to a multiple user community. after installing Buddypress, Authors can write and publish post just like before, so.. it is not hard anymore.Thanks

      Reply
  20. reddit May 5, 2012 at 4:50 am #

    Do youve a spam problem on this internet site; I also am a blogger, and I was questioning your situation; we now have developed some great techniques and we are looking to trade solutions with other folks, be positive to blast me an e-mail if planning to pursue.

    Reply
  21. Lucas Garvin July 14, 2012 at 3:11 am #

    You are my hero! Awesomeness!

    Reply
  22. Raphael C. January 23, 2013 at 2:50 am #

    Can anyone tell me if this enables the indexing of my group forums topics in sitemap.xml? Regards!

    Reply
    • Bowe Frankemo February 14, 2013 at 10:10 pm #

      No it does not. Since BuddyPress does not use custom post types for groups, the sitemap will not pick them up.

      Reply
  23. Rashid Manhas November 19, 2013 at 8:38 pm #

    Great Blog! Thanks

    Reply

Trackbacks/Pingbacks

  1. [bp] and WordPress SEO titles - WP-Pompey - October 27, 2011

    [...] As appears to be often the case, I developed my own fix before finding that someone else had done the same sort of thing. e.g. making BuddyPress compatible with the WordPress SEO plugin [...]

  2. carmichael - May 9, 2012

    abrasion…

    These instructions seem easy.However, I have just a question or two.In, “To Publish Content on your Website”, you wrote, “If your network has a name resolution system (typically DNS), then visitors can simply type your computer name in the address b…

Leave a Reply