Skip to:
Content
Pages
Categories
Search
Top
Bottom

Can’t seem to work on Yoast SEO plugin


  • kmligue
    Participant

    @kmligue

    Hi,

    We’re trying to use Yoast on BuddyPress pages (e.g. activity page, members’ directory, etc.) and it seems like setting for title, meta description, open graph, etc. are not taking effect. The meta’s are not outputted in the source. On non buddypress pages everything is fine. Can you please advice what we need to do?

Viewing 9 replies - 1 through 9 (of 9 total)
  • It’s quite probable it just won’t work. BuddyPress intentionally interferes with the page that WordPress thinks its loading (when it’s a BuddyPress URL), and I suspect Yoast SEO will look at this page object, and because we’ve messed with it and because it doesn’t map to a real WordPress Page, it won’t work.

    Sorry!


    kmligue
    Participant

    @kmligue

    Are there any suggested workarounds?


    mairaj
    Participant

    @mairaj

    If you like to keep using Yoast for WordPress pages and exclude BuddyPress from using Yoast, you may try this.

    function wpseo_fix_title_buddypress($title) {
        // Check if we are in a buddypress page 
        if ( function_exists( 'buddypress') && ( !empty( buddypress()->displayed_user->id ) || !empty( 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');

    wjh
    Participant

    @wjh

    Thanks @mairaj!

    I just pasted it as is into my bp-custom.php and it worked a treat.


    yazidaqel
    Participant

    @yazidaqel

    Thanks @mairaj
    Your suggestion is working perfectly


    mfalk75
    Participant

    @mfalk75

    @mairaj Thanks for your solution, seems to be working great. One thing though, I noticed my group forum topics still don’t display. The seo meta title is just the name of the group forum for individual topics. Thant can’t be good.


    jemar707
    Participant

    @jemar707

    This doesn’t seem to be working for me. Is it still a good fix for everyone else? The setting for title, meta description, open graph, etc. from Yoast settings are still bbeing ignored and the metas are not being outputted in the source.


    Japracool
    Participant

    @japracool

    Where do I put this code @mairaj?


    balebond
    Participant

    @balebond

    I just implemented this approach.

    I’m still reviewing the impact but so far so good I guess. Took out the part referencing buddyblog since I’m not using that plugin.

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.
Skip to toolbar