I have a custom post type called "recipe" with the has_archive parameter set to true. Visiting mysite.com/recipe/ gives a basic archive list of all the recipes posted and a page title of "Recipes". So far so good.

Now I'm looking to disable that recipe archive page (but keep individual recipe links working). My first thought was to try setting has_archive to false, which sounds like it should do the trick. Nope. The only difference this makes is the page title which for some reason becomes the name of the site. The actual archive is still displayed.

What is the best way to actually remove that archive completely? Is there a parameter of register_post_type that will achieve this or is it impossible and a case of a custom page template with a redirect in it?


  • 2
    Did you flush your rewrite rules after setting 'has_archive' => false? Commented Oct 10, 2013 at 11:53
  • Good point @ChipBennett, I did not! Works as expected now, thanks :)
    – Shellbot
    Commented Oct 10, 2013 at 12:07

1 Answer 1


The has_archive parameter for register_post_type() does exactly what you expect it to do. However, it modifies rewrite rules when set. So, if you change it to false, you'll need to flush your rewrite rules in order for the archive index display to be removed entirely.

  • 1
    Note: this just needs to be done once. An easy way to do this is, for instance, to visit Settings->Permalinks and re-save the current settings. This will flush rewrite rules.
    – nico
    Commented Aug 29, 2015 at 14:43
  • 5
    Note that this doesn't actually disable archives; it only disables the pretty URL for accessing them (mysite.com/recipe/ in this example). The archive still exists and is reachable at mysite.com/?post_type=recipe as long as the post type is publicly queryable.
    – Mark
    Commented May 4, 2016 at 19:34
  • how do you flush rewrite rules ?
    – djack109
    Commented May 28, 2020 at 1:38
  • @djack109 - It's literally written 2 comments above yours... Commented Mar 9, 2023 at 6:29

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.