WordPress.org

Ready to get started?Download WordPress

Forums

WordPress SEO by Yoast
Working with Buddypress and BP Docs? (21 posts)

  1. SydneyDesigner
    Member
    Posted 2 years ago #

    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.

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

  2. Joost de Valk
    Member
    Plugin Author

    Posted 2 years ago #

    I've never had it fully working yet, but patches are welcome, of course :)

  3. SydneyDesigner
    Member
    Posted 2 years ago #

    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?

  4. howdous
    Member
    Posted 2 years ago #

    @ Joost de Valk - I have followed this excellent tutorial for your plugin - http://www.seomoz.org/blog/setup-wordpress-for-seo-success

    After that I used this solution - http://bp-tricks.com/coding/making-buddypress-compatible-with-the-wordpress-seo-plugin-from-yoast/

    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.

  5. SydneyDesigner
    Member
    Posted 2 years ago #

    @ 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.

    Cheers,
    Marc

  6. SydneyDesigner
    Member
    Posted 2 years ago #

    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: http://www.generalthreat.com/2012/04/extending-buddypress-group-hierarchy-adding-breadcrumbs-to-your-theme/ 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;
     	}
  7. indietravel
    Member
    Posted 1 year ago #

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

  8. SydneyDesigner
    Member
    Posted 1 year ago #

    @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.

  9. indietravel
    Member
    Posted 1 year ago #

    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.

  10. SydneyDesigner
    Member
    Posted 1 year ago #

    @indietravel
    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.

  11. madarinho51
    Member
    Posted 1 year ago #

    @indietravel & @SydneyDesigner :

    Same problem here ... Any progress on your side ?

  12. indietravel
    Member
    Posted 1 year ago #

    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).

    http://indietravelpodcast.com/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.

  13. SydneyDesigner
    Member
    Posted 1 year ago #

    @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.

  14. madarinho51
    Member
    Posted 1 year ago #

    Hi,

    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 ?

  15. SydneyDesigner
    Member
    Posted 1 year ago #

    @madarinho51

    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.

  16. madarinho51
    Member
    Posted 1 year ago #

    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

  17. Kyle H
    Member
    Posted 1 year ago #

    I tried changing add_filter( ‘wp_title’, ‘bp_modify_page_title’, 10, 3 ) to add_filter( ‘wp_title’, ‘bp_modify_page_title’, 16, 3 ) and it did not seem to work for me. It looks like it is still enforcing the Yoast SEO titles. I even tried adding add_filter( ‘wp_title’, ‘bp_modify_page_title’, 16, 3 ) to bp-custom.php.

    Any ideas? I would love to be able to get SEO titles working on all my buddypress pages.

  18. madarinho51
    Member
    Posted 1 year ago #

    Hi,

    Forgot to mention I had to include this in my header.php

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

    Hope this helps

  19. Kyle H
    Member
    Posted 1 year ago #

    Ok, Well thanks but it still doesn't seem to work for my themes.

    I am using Artisteer 4.0 themes. I added the line above you told me to add to the top and also tried adding add_filter( ‘wp_title’, ‘bp_modify_page_title’, 16, 3 ) to bp-custom.php and changing it directly in the core file.. I did not see any changes to my member profile titles.

  20. Kyle H
    Member
    Posted 1 year ago #

    Oh, and this is what I see for the title code that is already in the header. This is what I was replacing with the code that you provided.

    <title><?php wp_title('|', true, 'right'); ?> <?php bloginfo('name'); ?></title>

  21. sevelina
    Member
    Posted 1 year ago #

    Same problem here ... Any progress??

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic