I have multiple custom post types and custom taxonomies, "staff", "games", which have the permalinks:


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?


2 Answers 2


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

  • 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, 2011 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, 2011 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, 2011 at 12:07

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

Your Answer

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