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 have multiple custom post types and custom taxonomies, "staff", "games", which have the permalinks:

domain.com/staff/%staff-name%
domain.com/games/%game-name%

However, I'm only using these custom posts to store data and am displaying it collectively on different pages. How do I get the paths, such as, /staff/%staff-name% to redirect to the 404 page?

Thanks!

share|improve this question

2 Answers 2

If you set the "rewrite" argument to "false" when registering the custom post type, no rewrite rules will be generated.

share|improve this answer
1  
Additionally, if you don't want them to be queryable on public facing pages, you may also wish to set query_var to false, but note that doing so disables preview for that type - ie. preview post. –  t31os Jan 26 '11 at 11:45
    
@t31os: Ha, that's interesting! But of course, if you only use the custom posts in other situations, the preview doesn't matter that much. Unless you create a special preview template that combines all these different situations. (But I think you need to play with template_include for that, there is no special template file name for previews?) –  Jan Fabry Jan 26 '11 at 11:59
    
I don't think there's such a thing as a preview template, but it's interesting idea... templates for post previews. –  t31os Jan 26 '11 at 12:07

Setting these posts as "private" should do what you want - (unless I misunderstood your question)

share|improve this answer

Your Answer

 
discard

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