When I'm working with Wordpress's permalink system, I can create plenty of options for creating permalinks, like so:


But if I add introduce a new kind of content type, say portfolio pieces, so I can have a url like:


The permalink options I do have (and have been using for the last 3-4 year's worth of posts), means that end up with ugly urls like:


I want all the existing links to work for posts that have already been at:


But I also want to make custom posts available at:


How I'd normally do it

The approach I've normally do would be:

  • remove the hard coded blog slug, from the permalinks to that the new permalink structure was /%year%/%monthnum%/%day%/%postname%/

  • Add a rule in apache to 301 all requests for domain.com/blog/YYYY/MM/DD/old-post to domain.com/YYYY/MM/old-post, for SEO and suchlike.

As far as I know, this would mean that any existing links to

http://domain.com/blog/YYYY/MM/DD/old-post would still work, although browsers would end up at:


I'd still have the decent urls for custom post types too, at


Is this how you'd do it?

I feel fairly comfortable about this approach - I could improve the naming structure for SEO while maintaining performance, by removing the days or even years and have something like this:


I'm not sure how I'd allow for custom permalink structure here, but is there anything else I should bear in mind here when fixing links like this?

2 Answers 2


When you register your taxonomy you can create the rewrite rule for the slug

register_taxonomy('investment_country',array('investment'), array( 'hierarchical' => true, 'labels' => $labels, 'show_ui' => true, 'query_var' => true, 'rewrite' => array( 'slug' => 'country' ), ));

so whenever I'm showing something that I have included in the country taxonomy I get http://www.domain.com/country/unitedkingdom for example

don't forget you'll need to resave your permalinks


hope you are created custom pot type called portfolio, as of my understanding just go to custom permalink structure should be /%postname%/

And create custom category or archive template to get hold on porfolio category template

have a look at template hierarchy http://codex.wordpress.org/Template_Hierarchy

in your case your template name should be category-porfolio.php for single.php it should be single-portfolio.php

these templates are exclusive for your portfolio post type

  • Hi S kumar, that's not the issue The question is more about routing - because there's a hardcoded 'blog' in the permalinks slug, all custom-post type urls end up with 'blog' prepended. I'm trying to make the content available at a specific url. Thanks anyway though! Commented Dec 1, 2011 at 11:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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