Support » Plugin: Yoast SEO » [Plugin: WordPress SEO by Yoast] Working with Buddypress and BP Docs?

  • I’m using WP3.3.2 and get this issue on WPSEO 1.9 and on the development version. I’m using WPSEO with the latest Buddypress 1.5.5 and the latest BP Docs 1.1.22. I hope you can help me out please.

    With <title><?php wp_title(”); ?></title> and wp_head() in header.php , WPSEO sets the non-Buddypress post/page titles/descriptions OK and lets Buddypress set the titles for the Buddypress (i.e. groups etc.) pages OK. The exception is that I can’t get WPSEO to set the titles/descriptions for the BP Docs custom post type pages. Any tips to do this please?

    By the way, with WPSEO “Force Rewrite Titles” set, WPSEO does set the titles/descriptions for the BP Docs custom post type pages but no longer lets Buddypress set the titles for the Buddypress (i.e. groups etc.) pages – instead these titles just default to equal the Buddypress page urls.

    Am I missing some trick to getting WPSEO working with work with Buddypress and BP Docs?

    Many thanks for your support Joost.

Viewing 15 replies - 1 through 15 (of 20 total)
  • Plugin Author Joost de Valk


    I’ve never had it fully working yet, but patches are welcome, of course 🙂

    Thanks Joost. If you (or anyone else?) could point me in the right direction with a few tips, I’d be very grateful and will repost my successes! I’ve done a bit of patching, but this one seems a bit tricky for me.

    Basically, it would be very useful to me (and most likely to others too) if WPSEO (set as normal with <title><?php wp_title(”); ?></title>) works with Buddypress like it currently does, plus works with BP Docs like WPSEO currently does with WPSEO “Force Rewrite Titles” set.

    Any guidance on achieving this please?

    @ Joost de Valk – I have followed this excellent tutorial for your plugin –

    After that I used this solution –

    with Buddypress and with a bit of legwork and figuring out I got it mostly working, but not 100% yet.

    Would appreciate it if you could give some feedback here once you have found a proper solution for your plugin, WordPress SEO, with Buddypress.

    BTW: Your plugin rocks on standalone WordPress as well as WordPress MU. Holding thumbs for a solution for Buddypress.

    @ Fanus van Straten – thank you for your reply and references, very useful.

    You said: “with a bit of legwork and figuring out I got it mostly working, but not 100% yet.” Please can you share the hacks you have used so far, to help me on my way. Hopefully I can reciprocate later.

    Many thanks.


    I hope the following patches will help some people. The only trouble is that the patches work with WordPress SEO Version 1.2.3 but not with the two newer versions: WordPress SEO Version 1.2.4 or 1.2.5 Something changed moving to WordPress SEO 1.2.4 and it would be great if @ Joost de Valk could help to fix this please, so we can keep with the latest WordPress SEO. Please let me know Joost. Many thanks.

    I’ve managed to get WordPress SEO Version 1.2.3 working quite nicely with Buddypress (latest versions up to and including Buddypress 1.6 Beta 2) and Buddypress Docs (latest version 1.1.24) on WordPress 3.4.1. The WordPress SEO box appears fine for all Buddypress Docs and allows me to enter the SEO titles and meta description OK. Unfortunately, this WordPress SEO box doesn’t even show for WordPress SEO Versions 1.2.4 and 1.2.5 and I’d love a fix to this please – see above.

    I then use the code below in my functions.php. Any improvements gratefully accepted as I am new to coding. Thanks to: for pointing me in the right direction on this.

    add_filter( 'bp_modify_page_title', 'marc_hierdoc_title', 10, 4 );
    function marc_hierdoc_title( $hierdoc_title, $title, $sep, $seplocation  ) {
    	global $bp, $wp_query, $post, $wpseo, $bp_docs;
     	if( bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) ) {
     		/** Remove the name of the group from the title*/
    		$hierdoc_title = substr( $hierdoc_title, strpos( $hierdoc_title, '|' ) );
    		/** Add the full group hierarchy to the title */
    		$hierdoc_title = bp_group_hierarchy_get_full_name( '|', $bp->groups->current_group) . ' ' . $hierdoc_title;
    		/** If BP Doc then replace title with title input via Yoast WordPress SEO plugin */
    	} if ( bp_docs_is_existing_doc() && bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) ) {
    		$doc = bp_docs_get_current_doc();
    		$doc_id = $doc->ID;
    		$hierdoc_title= get_post_meta( $doc->ID, _yoast_wpseo_title, true);
    	return $hierdoc_title;
    add_action('wp_head', 'marc_doc_metadesc');
    function marc_doc_metadesc( $doc_metadesc ) {
    	global $bp, $wp_query, $post, $wpseo, $bp_docs;
    	if ( bp_docs_is_existing_doc() && bp_is_active( 'groups' ) && !empty( $bp->groups->current_group ) ) {
    		$doc = bp_docs_get_current_doc();
    		$doc_id = $doc->ID;
    		$doc_metadesc= get_post_meta( $doc->ID, _yoast_wpseo_metadesc, true);
    		$doc_metadesc="<meta name=\"description\" content=\"$doc_metadesc\">";
    		echo $doc_metadesc;

    @sydneydesigner Did you have any luck finding an upgrade path? This still hasn’t been officially addressed, and it’s driving me mad!

    @indietravel Yes, and no…..
    I’m now using WP3.5.1, WPSEO 1.4.4, BP 1.6.4, BP Docs 1.3.1

    Yes, WPSEO does set the titles/descriptions for the BP Docs custom post type pages – just like it does for the WP pages.

    No, WPSEO still does not set the titles/descriptions for the BuddyPress (i.e. groups etc.) pages – i.e. WPSEO is not integrated with BuddyPress, which is a real shame in my view.

    Thanks Marc, @sydneydesigner – WPSEO still seems have the same cannonical issues with groups and forums, etc. Trying to find some way to make it all work! Was hoping your solution here might do the trick.

    Sounds like we are after the same thing….as I guess are many other people. Here is something I posted on BBPress forum a while back. But no help was forthcoming – yet – I’m still hoping someone can help! I’m planning to get back on to it after moving to BP 1.7 and BBP 2.3, but coding is not my strength so I sure would like some pointers please, if anyone out there can help us.

    @indietravel & @sydneydesigner :

    Same problem here … Any progress on your side ?

    I migrated my forums off to BBPress, which solved the problem for those. They’re now starting to get indexed, and we can also take full advantage of the WPSEO settings to manipulate the metadata (if we ever have time to do something like that for forums).

    Unfortunately, after hours of creative play we couldn’t get them playing nicely with the BP group-based stuff at all. I think there are some changes coming in 1.7 (which is due soon), and it might be worth holding off for them: I know there are changes around how forums are done, but don’t know the details.

    @indietravel and @madarinho51

    I think I just need to find out how to get the main bbPress topic id from a Buddypress group>forum>topic+replies page. But I’m currently stuck on this. Any ideas anyone?

    Once I get that, then I think I will have a function which shows each topic’s WPSEO meta title and meta description for the appropriate Buddypress group>forum>topic+replies pages (rather than the current BuddyPress metadata). Once I get it working, I intend to share my function with the community, as quite a few people seem to be after this.

    So I hope someone can help us all please.


    Thanks for the replies SydneyDesigner and IndieTravel.

    On my side I also use the BBpress forums, so no problems for their titles.

    My problem is more to get unique titles to profiles, groups and so on …

    When Yoast is not activated it is showing proper titles.

    So I wonder if the solution for me could be to exclude all Buddypress pages from Yoast SEO ?

    Sorry but with my limited coding skills I am afraid I won’t be of a big help for your solution SydneyDesigner but yes there is definitively a lot a people looking for this solutions, and yet with BP 1.7 making it compatible out of the box with most of the theme the number of people is gonna get growing.

    Could you Joost maybe have a look on that as the demand will be bigger and bigger ?


    So I wonder if the solution for me could be to exclude all Buddypress pages from Yoast SEO ?

    I worked out how to do this by a one line BuddyPress core code hack, a technique which is frowned upon but it does work for me and I don’t know how to do it better. (If anyone can advise us how to put this into a child theme functions.php we’d love to hear from you please.)

    I change the priority from 10 to 16 in this line which is in buddypress>bp-core>bp-core-filters.php:
    add_filter( ‘wp_title’, ‘bp_modify_page_title’, 16, 3 );

    For all BuddyPress pages, this makes bp_modify_page_title filter execute after, and hence overrule, WPSEO title which has priority 15 (in worpress-seo>frontend>class-frontend.php).

    I hope this helps people.

    Hi there,

    Thanks for the tip it worked for me !

    I now have unique titles as it should be.

    Not exactly the same separator than on my other wordpress pages (I am using “-” and bp is using “|”) but it doesn’t matter that much compared to before

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘[Plugin: WordPress SEO by Yoast] Working with Buddypress and BP Docs?’ is closed to new replies.