• mihaylovra

    (@mihaylovra)


    Hello!
    Is it possible to make a meta title and description for a page with profile search results.

    For example, on a page like /members/?members_search=CITY there would be a meta title and a description: Participants from the city CITY.

    I would like to make landing pages from such pages to attract traffic from advertising and search engines.

    There is such a code for changing the title in the profile. How can I redo it for search results? Help please.

    CODE:

    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, %s ', bp_get_displayed_user_fullname(), bp_get_displayed_user_username(), bp_get_member_profile_data('field=City'), bp_get_member_profile_data('field=Страна') );
    	} 
    	return $title;
    }
    
    add_filter( 'wpseo_title', 'bpdev_bp_items_title' );

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Andrea Tarantini

    (@dontdream)

    Hello mihaylovra,

    The search results page is the same page as the member directory.

    Do you wish to apply your changes to the standard BuddyPress member directory, or to a custom directory you built with BP Profile Search?

    Thread Starter mihaylovra

    (@mihaylovra)

    Hi, Andrea Tarantini

    Each profile contains a city and if you click it, you go to a page with all the participants from that city.

    Example https://znakomstva.net/members/?members_search=%D0%9C%D0%BE%D1%81%D0%BA%D0%B2%D0%B0

    Here for such pages I would like to create a meta title and descriptions.

    Plugin Author Andrea Tarantini

    (@dontdream)

    I see you are using the standard BuddyPress member directory.

    If you can code, I can quickly offer some suggestions. If, on the other hand, you prefer ready-made code, I will need a few days to write and test it.

    Please let me know!

    Thread Starter mihaylovra

    (@mihaylovra)

    Unfortunately, I’m not good at programming. I would like a ready-made code.

    Please help me if you can.

    Plugin Author Andrea Tarantini

    (@dontdream)

    OK, I’ll try to put the code together in the next few days, please be patient!

    Thread Starter mihaylovra

    (@mihaylovra)

    Thanks

    Plugin Author Andrea Tarantini

    (@dontdream)

    Hello mihaylovra,

    I spent some time to write that code, but without success. There is some interaction between BuddyPress and Yoast SEO that I don’t understand and unfortunately I don’t have the time to research right now. Sorry!

    Thread Starter mihaylovra

    (@mihaylovra)

    Hello!

    Understand. Thanks for trying!

Viewing 8 replies - 1 through 8 (of 8 total)

The topic ‘Meta title and description for the search results page’ is closed to new replies.