I am working with a client who has a directory site that allows users to create accounts, then lists of items from the directory. Right now, whenever a user creates an account, she gets a profile URL like:


Which is accomplished with a simple:

$wp_rewrite->author_base = 'member';

Now, I need to allow those users the ability to create a list, which should result in this kind of a URL structure:


So far, I'm creating these lists as custom post types. All of the articles and Stack Exchange posts I see on WP_Rewrite don't cover a URL rewrite like this. Is this possible? Do you have any pointers on how this could be done?

  • I also have this question, though in my case, the /%list% won't always be a custom post type. Did you ever figure this out? – Ryan Oct 16 '12 at 7:31

Option 1

I assume custom post type generate a URL something like this


So you could write it so it looks as... since the main URL doesn't have author before custom type you would have to do this via a function since authors are dynamic

RewriteRule ^members/%author%/(.*)$ domain.com/%custom-post-type%/$1

This doesn't specifically modify the custom post type URLs but you should be able to modify this to your need https://gist.github.com/4336843

Option 2

or possibly if URL like this below and the custom post type doesn't change you should be able to implement this in .htaccess and it takes the author in to account when rewriting


RewriteRule ^members/(.*)/(.*)$ domain.com/members/$1/%custom-post-type%/$2

This has a very good explanation on rewrite URL in general http://www.addedbytes.com/articles/for-beginners/url-rewriting-for-beginners/

Option 3

Also you can rewrite the entire custom post type URL if you are not using it anywhere else... because

register_post_type(); accept 'rewrite' => array ($slug)

more info




add_rewrite_rule() should be the answer http://codex.wordpress.org/Rewrite_API/add_rewrite_rule

or you can manually filter author_rewrite_rules


I hope the following plugin will help you more: http://wordpress.org/extend/plugins/permalink-editor/

This plugin it will rewrite the permalink as you want it without any coding knowledge.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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