Skip to:
Content
Pages
Categories
Search
Top
Bottom

User Profile Url uses the username. Can that be changed?


  • J
    Participant

    @paradox_designs

    Hi,

    Using bbP 2.3.2 on WP 3.6.

    This may seem silly but isn’t using a user’s username (aka their login username) in their public profile url a reduction in security?

    In any case, I want to see if there is any possibility to change that. the main reason is that for other reasons we have used people’s email addresses as the usernames when creating accounts. This made some sense at the time but provides an issue where now that we have added bbPress, people’s profile url includes their email address. something most of them will probably not like, and is reduction in security and privacy.

    Is there a way to make it something like http://www.sitename.com/users/firstname_lastname/ instead?

    or is there any other ideas as how to solve this dilemma?

    Thanks

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

  • J
    Participant

    @paradox_designs

    After 2 months I have resolved this. if anyone else needs help just ask


    dotdatdot
    Participant

    @dotdatdot

    Please do share your solution here as I agree with this being an issue. Thanks in advance!


    J
    Participant

    @paradox_designs

    
    add_action( 'init', 'nicenames_to_display_name' );
    function nicenames_to_display_name() {
        foreach ( get_users() as $user ) {
    		if ( $user->data->user_status == 0 && $user->data->user_nicename != $user->data->display_name ) {
    			$user_ids[] = $user->ID;
    		}
    	}
    	foreach( $user_ids as $uid ) {
    		$info = get_userdata( $uid );
    		$display_name = $info->data->display_name;
    		if ($display_name) {
    			$args = array(
    				'ID'            => $uid,
    				'user_nicename' => strtolower(str_replace(" ", "_", $display_name))
    			);
    			wp_update_user( $args );
    		}
    	}
    }
    

    Jgonl
    Participant

    @jgonl

    Where to put the code?


    Jgonl
    Participant

    @jgonl

    Thanks … ok


    J
    Participant

    @paradox_designs

    Damn, sorry. i hate when others do it and I end up doing it myself…

    This goes in functions.php


    Jgonl
    Participant

    @jgonl

    I figured I should go where the code and may assert.
    Thank you again


    fatsandrew7
    Participant

    @fatsandrew7

    wow! exactly what i was looking for!

    thanks so much!

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

You must be logged in to reply to this topic.