• Resolved mihaylovra

    (@mihaylovra)


    Hello!

    I would like to set up the Meta Title and Description of the profile in Buddypress. For example, to be in the Meta Title: User name, city, country.

    How to do it? Help please.

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Support Michael Ti?a

    (@mikes41720)

    Hi @mihaylovra

    Are the Buddypress profile pages editable in the WP backend? If so, it should show up as a content type that you can configure the default title and meta description template – https://yoast.com/help/how-to-modify-default-snippet-templates-in-yoast-seo/

    You can view the available snippet variables that you can use here – https://yoast.com/help/list-available-snippet-variables-yoast-seo/

    You can also choose to edit a page specifically and then set the SEO title and meta description in the Yoast SEO meta box.

    Thread Starter mihaylovra

    (@mihaylovra)

    Hi @mikes41720

    There are no such settings anywhere. For some reason the plugin doesn’t work with baddypress. What can be done?

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi @mihaylovra

    If the content type isn’t editable in the backend, you can’t really access the Yoast SEO meta box and edit those fields or settings. Perhaps you can take a look at our metadata API and see if you can use these filters to output the meta tags for those BuddyPress profiles – https://developer.yoast.com/customization/apis/metadata-api/

    Thread Starter mihaylovra

    (@mihaylovra)

    It turned out to make a profile title as well:

    /**
     * Filters wpseo meta title.
     *
     * @param string $title title.
     *
     * @return string
     */
    function bpdev_bp_items_title( $title ) {
    	if ( bp_is_blog_page() || bp_is_directory() ) {
    		return $title;
    	}
    	if ( bp_is_user() ) {
    		$title = sprintf( ' %s @%s looking for dating in %s ', bp_get_displayed_user_fullname(), bp_get_displayed_user_username(), bp_get_member_profile_data('field=City') );
    	} 
    	return $title;
    }
    
    add_filter( 'wpseo_title', 'bpdev_bp_items_title' );

    Thanks for the help!

    Plugin Support Michael Ti?a

    (@mikes41720)

    Hi,

    We’re glad to hear you were able to use the filters to get the expected output!

    We’ll be closing this thread in order to keep the forum overview.

    Thanks.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Meta Title and Description of the profile in Buddypress’ is closed to new replies.