Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I am working on a site where they want to break up the content into custom post types (right now everything is broken up by post categories) but they want to be able to save their URLs to preserve inbound links and Facebook Likes. They currently have a date-based URL structure (example.com/2013/01/11/the-post-name) and they want to keep that but still use custom post types.

I've seen plugins that will allow me to easily append the date before the post title in the URL, but nothing that removes the slug from the first URI segment. I tried to add a rewrite rule to remove the slug (rewrite => array( 'slug' => '' )) but that resulted in 404s.

What's the best way to go about this? I know it's bad practice to remove the slug, but the client is pretty adamant about it.

share|improve this question

1 Answer 1

You can't. Permalink rewrite rules are a set of patterns that the URI is matched against. If they all share the same pattern, one will always take precedence, so you will only have a single post type that will not 404. Categories (or some other taxonomy) is the way to differentiate content that shares the same URL structure.

share|improve this answer

Your Answer

 
discard

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.