Skip to:
Content
Pages
Categories
Search
Top
Bottom

Create SEO-frendly URL’s for user profile in BuddyPress


  • arnezami
    Participant

    @arnezami

    Hi everyone!

    We are using on our website Buddypress and want to make more SEO frendly profile url’s

    example.com/{City}/{Instrument}/{Firstname-Lastname}
    example.com/{City}/{Style}/{Band-Or-Ensemble name}

    it posible with standart post types with hierarchical categories, but I didn’t found posibility to add taxonomy to activity and groups.

    ust small clarification:

    I have url’s:
    example.com/members/{user}
    I want them to be more SEO friendly such as:
    example.com/{City}/{Instrument}/{Firstname-Lastname}
    example.com/{City}/{Style}/{Band-Or-Ensemble name}

    I have found the way, how to update url’s structure:
    in functions.php

    add_filter( 'bp_get_member_permalink', 'custom_bp_get_member_permalink' );
    
    function custom_bp_get_member_permalink(){
    	global $members_template;
    
    	$url = get_site_url();
    	$city = xprofile_get_field_data('City', $members_template->member->id);
    	$instrument = xprofile_get_field_data('Instrument', $members_template->member->id);
    	$full_name = $members_template->member->fullname;	
    	return $url.'/members/'.convert_to_url_ready($city).'/'.convert_to_url_ready($instrument).'/'.convert_to_url_ready($full_name);
    }

    but I need to rewrite url’s to get user’s pages.
    Wating for any ideas. Thanks in advance.

  • You must be logged in to reply to this topic.
Skip to toolbar