The default install of Wordpress archives the post of an “author” on a page with the page slug “/author/{name}”. Have you ever wanted something different on your multi-author blog?
The question came up during our redesign of MyBiggestComplaint.com. We realized our authors had become much more than authors, they were full-on, pedal to the metal users. That default “author” slug for archives had to be changed.
What’s the first thing you do when you want to change something in Wordpress? Look for a plugin, right?
I couldn’t find anything in my self-imposed plugin search time limit of 30 seconds on Google so I decided to write a plugin myself. And then I didn’t.
I didn’t write a plugin because I got what I wanted by changing one word in all the lines of code of Wordpress. I could have kept on with a plugin and written a few more lines of code, but why?
One of the major ideas behind Wordpress plugins is that a plugin will help you survive an upgrade. With Wordpress getting ready to release v2.3, the releases are coming much more quickly than before. Plugins are always preferred to a hack of the core code. Once you hack the core, an upgrade will destroy your hack.
I’m not sure really if changing one word of one line of code counts as a hack, but as far as production time was concerned, it seemed like the right thing to do.
If you want to change the default author archive slug for Wordpress from “/author/” to something different, like “/user/”, “/hot-chick/”, “/hokie/” or whatever you want, open /wp-includes/rewrite.php and look around line 168 for
var $author_base = 'author';
and change it to
var $author_base = 'user';
Save the file and update your permalinks underOptions/Permalinks and you’re done.
Technically, it’s a hack. Probably not a good idea, but it’s only one word and it’s a lot quicker than finding or writing a plugin that would do the same job. It’s also major enough for you to remember to re-do it the next time you upgrade. Even if you didn’t, it’ll only take about a second to remember to do it when your author pages started coming up 404 after an upgrade.
You might also add a permanent 301 redirect in your .htaccess file to take care of old links to the old /author/ pages like this
Redirect 301 /author/ http://yoursite.com/user/
See it in action on the new and improved “user” pages at MyBiggestComplaint.com.









GadgetGadget.info - Gadgets on the web » Does Your Blog Have “Authors” Or “Users”? wrote,
[…] "Walter, Patrick A" wrote an interesting post today!.Here’s a quick excerptThe question came up during our redesign of MyBiggestComplaint.com. We realized our authors had become much more than authors, they were full-on, pedal to the metal users. That default “author” slug for archives had to be changed. … […]
Quote | Link | September 21st, 2007 at 1:29 pm
DicyncMic wrote,
Fantastic issue, did not thought this would be so cool when I looked at the title.
Quote | Link | November 25th, 2009 at 7:54 am