WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have a sample code:

function change_author_permalinks() {
    global $wp_rewrite;
    $wp_rewrite->author_base = 'u';
    $wp_rewrite->author_structure = "/" . $wp_rewrite->author_base . '/%author%';
    add_rewrite_rule('u/([^/]+)/?$', 'index.php?author_name=$matches[1]', 'top');

but my current front set on my blog is:

t%post% (ex: www.domain.com/tauthor/username)

I want change to:


But when run code, result is page not found ? How to fix it ?

share|improve this question
I'm not familiar with the matter, but what does $this->front has to do with this? As you use it in the title, but not in the content of the Question... – brasofilo Jan 17 '13 at 16:13
Possible duplicate of wordpress.stackexchange.com/questions/77228/… – chrisguitarguy Jan 18 '13 at 21:04

You're close, but you don't need the add_rewrite_rule call.

add_action('init', 'wpse82004_init');
function wpse82004_init()
    global $wp_rewrite;
    $wp_rewrite->author_base = 'u';
    $wp_rewrite->author_structure = '/' . $wp_rewrite->author_base . '/%author%';

After that's in place, just re-save permalinks.

Here's a plugin to put an option on your permalinks page to do this.

share|improve this answer
What does the author_structure part do that isn't handled by the author_base? Just curious, because I've not been using that line and it seems to work. – helgatheviking Jan 18 '13 at 21:12
If you have your permalinks without a "front" it will work. Eg. /%year%/%month%/%postname%. If there is a front (eg. /this-is-a-front/%postname%) it won't work. – chrisguitarguy Jan 18 '13 at 21:16
Thanks for clearing that up. I will update my live code based on your answer, so definitely +1 from me! – helgatheviking Jan 19 '13 at 0:28

This is what I did to change the author base:

// change base of author pages- need to save permalinks to take effect
function wpa_82004(){
    global $wp_rewrite;
    $wp_rewrite->author_base = 'people'; // or whatever

Once you've run this, be sure to re-save your permalinks. (Options->Permalinks) You have to flush your rewrite_rules to even know if this is working.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.