• Is it possible to change a username in functions.php to /firstname-lastname?

    I got this function to change the author slug:

    global $wp_rewrite;
    $wp_rewrite->author_base = “member”; // or whatever
    $wp_rewrite->flush_rules();

    /author/ to /member/

    But now I want so that I replace the username which today is the “author page” and it looks like:

    /member/en and change it to /member/example-name

    Can I control this by instead targeting username to target the first name and the last name in my profile?

    I can just simply go into phpmyadmin and change it, but then I need to change every 150 member I got, manually. Is there any way around this?

    No. I don’t want to use plugins like Edit Author Slug to do this. I don’t like to many plugins on my site.

  • The topic ‘Change Username-url with functions?’ is closed to new replies.