Skip to:
Content
Pages
Categories
Search
Top
Bottom

Bussdypress title and SEO Yoast problem


  • gidantrip
    Participant

    @gidantrip

    Hello
    I have a problem with SEO Yoast title. In my buddypress page (activity, memeber, etc) title page doesnot appear! I use SEO YOAST plugin and when a disable it it does work correctly.
    What can I do????

Viewing 25 replies - 1 through 25 (of 28 total)

  • Henry Wright
    Moderator

    @henrywright

    Hi @gidantrip

    Please see 6107


    gidantrip
    Participant

    @gidantrip

    Sorry but I cant understand hot to resolve problem in that linked ticket!!!


    djsteveb
    Participant

    @djsteveb

    I’ve run into the same problem and asked for ideas around here and seen others that have posted about it in the yoast forums a few times – don’t know why yoast does not get into the bp pages thing. I got some help from the wpmu-dev guys that cobbled together some code that creates page titles and meta descriptions for members and groups pages – which is awesome!

    Does not fix the member/username/messages and similar sub-sub pages (but I block those with robots.txt wildcard matching anyhow)

    Would like to see buddypress pages added to some kind of taxonmie thing that yaost would auto pickup.. and love to see the options for setting templates within buddypress itself, so as to not rely on yaost for some this, and custom mu=plugins hack to fix other parts of it… google’s webmaster tools alerts missing info on many pages of an active bp site, and has for a long time.


    gidantrip
    Participant

    @gidantrip

    sorry but can you give me that code to fix problem?
    Thanks


    djsteveb
    Participant

    @djsteveb

    I wish I could… but things are really screwey right now from what I can tell. If you read the 6107 linked info you would see that there are essentially three different code bases / thingys going on right now that are all producing different title results – see this spreadhseet: https://docs.google.com/spreadsheets/d/1ww95Q184EAHG0ztI9MtkdjpA2pALnMY0L-R7FA6QqGc/edit?pli=1#gid=0

    I had some code cobbled together to make everything “work” as I needed to fix most of the buddypress titles – but that was with buddypress 2.1.1 and Yoast 1.7.2 – now it seems that updating to 2.2 and 174 my custom cobbled code gets broken..

    so now I have an updated site, and updated plugin from yaost.. but if I activate the yaost plugin it overrides my custom page title and meta description settings (from the code I have added in mu-plugins folder) – for now I have disabled yaost, which has brought back my custom code to add titles and descriptions to many bp pages! But now that yoast is turned off, I have lost the custom titles and descriptions for the main pages of the web site – meh.

    Ash and Vladislav from premium.wpmudev.org came up with this code to wrap to fix my issues as it were before the latest yoast updates:
    (hmm.. I tried posting the code, and I get “Error your reply cannot be created at this time” – stupid bp.org – I think the word seks is offensive along with alt seks lifestyles here – anyway – you can probably see the code without being a member / loggin in here anyways:
    http://premium.wpmudev.org/forums/topic/bp-meta-tite-description-for-groups-and-members-pages#post-806736

    Some of that is hard coded instead of how it could be done (there is stuff in the codex about another method of calling “field’ => ‘age’, ‘user_id’ => $user_id))” stuff…. and there is not php tag at opening to make it plugin..


    gidantrip
    Participant

    @gidantrip

    not work πŸ™


    technologypoet
    Participant

    @technologypoet

    Hey all,
    After a few weeks of searching I found the solution to this – it’s a beautiful plugin called Plugin Organizer

    You can use it to disable Yoast on buddypress pages and viola!
    Just create a plugin filter for site.com/members/*, /groups/*, etc. and you’re golden.


    r0z
    Participant

    @r0z

    I solved this error without having to disable the SEO in BuddyPress pages, and without having to touch the core of the plugin.
    I’ll leave here (add in functions.php):

    
    function wpseo_fix_title_buddypress($title) {
        // Check if we are in a buddypress page 
        if (function_exists( 'buddypress') && buddypress()->displayed_user->id || buddypress()->current_component ) {
            $bp_title_parts = bp_modify_document_title_parts();
    
            // let's rebuild the title here
            $title = $bp_title_parts['title'] . ' ' . $title;
        }
        return $title;
    }
    add_filter( 'wpseo_title', 'wpseo_fix_title_buddypress');
    

    maybe this code or something similar would need to be implemented in Yoast SEO plugin… maybe.


    officeninjas
    Participant

    @officeninjas

    Thanks @r0z for the elegant solution.

    I would just add that in order to prevent PHP Notices, change the qualifier to the following:

    if ( function_exists( 'buddypress') && ( !empty( buddypress()->displayed_user->id ) || !empty( buddypress()->current_component ) ) ) {


    sharmavishal
    Participant

    @sharmavishal

    following this


    mingjie0409
    Participant

    @mingjie0409

    @r0z

    Thanks a lot for your code ,, after we use your code why the BP page title always show MEMBERS name + first blog name + site name … what’s wrong with it please ?

    We the first blog name always show in every bp page title ?? ONLY only me meet this question ??

    Please anyone know why ?

    You can check this bp page title from this link here : http://www.globaljike.com/members/globaljike/

    JK


    mingjie0409
    Participant

    @mingjie0409

    @djsteveb

    Thanks a lot for your code ,, after we use your code why the BP page title always show MEMBERS name + first blog name + site name … what’s wrong with it please ?

    We the first blog name always show in every bp page title ?? ONLY only me meet this question ??

    Please anyone know why ?

    You can check this bp page title from this link here : http://www.globaljike.com/members/globaljike/

    every member’s page alway show MEMBERS name + first blog name + site name

    open member’s page here http://www.globaljike.com/members/

    JK


    mingjie0409
    Participant

    @mingjie0409

    And also after add the code :

    http://globaljike.com/groups/
    http://www.globaljike.com/members/
    http://globaljike.com/activity/

    these thress page titles now :

    Groups Groups – site title
    Members Members – site title
    Site-Wide Activity Activity – site title


    lagodny
    Participant

    @lagodny

    I have the same problem.


    sharmavishal
    Participant

    @sharmavishal

    @technologypoet has mentioned the solution


    mingjie0409
    Participant

    @mingjie0409

    @sharmavishal

    but that plugin not update over 1 year


    mingjie0409
    Participant

    @mingjie0409

    @lagodny

    HI How could you resolve it ?

    jk


    sharmavishal
    Participant

    @sharmavishal

    @mingjie0409 did u test/check it? works for me


    Salvatore
    Participant

    @darkwolf

    thanks for this! work for me πŸ™‚


    Destac
    Participant

    @destac

    I have another potential fix if the above one is not working for anyone.

    if ( ! function_exists( 'myarcadetheme_remove_bp_wpseo_title' ) && function_exists( 'wpseo_auto_load' ) ) { function myarcadetheme_remove_bp_wpseo_title() { if ( ! bp_is_blog_page() ) { $myarcadetheme_front_end = WPSEO_Frontend::get_instance(); remove_filter( 'pre_get_document_title', array( $myarcadetheme_front_end, 'title' ), 15 ); } } add_action( 'init', 'myarcadetheme_remove_bp_wpseo_title' ); }

    You can add that in a site plugin or a child theme’s functions.php

    Also feel free to rename the function to whatever you want \0 I like to keep it the name of the theme I am using

    Confirming, that @destac solution works ok.
    First appeared in a Yoast/wordpress-seo repository open issue.


    lagodny
    Participant

    @lagodny

    good news!

    how to change the “Title – SiteName” to “Title | SiteName”

    @lagodny

    Put this code in functions.php of your (child) theme.

    function lagodny_document_title_separator_pipe( $separator ) {
        return '|';
    }
    add_filter('document_title_separator', 'lagodny_document_title_separator_pipe');

    I assume that you are on the WordPress 4.4+.


    BGRATED
    Participant

    @bgrated

    Hi guys… I know this is a bit old.
    I would LOVE to have it as this.
    name – gender – age – city | MyWebsite.com

    I use the extended profile fields (gender) <- drop down pick only one., (Birthday) as primary and (city) text box.

    All are primary and required. I had something like this before (not buddypress) and I found the search results awesome.

    Thank you if anyone could help.
    The above code works like a charm.


    BGRATED
    Participant

    @bgrated

    Quick update. SORRY GUYS. my site needs first name last name. So if anyone does know how I would like it like this first name{space}last name – gender – age – city | MyWebsite.com

Viewing 25 replies - 1 through 25 (of 28 total)
  • The topic ‘Bussdypress title and SEO Yoast problem’ is closed to new replies.
Skip to toolbar