Skip to main content
1 of 2
mrwweb
  • 10.3k
  • 5
  • 40
  • 75

Use register_post_type() to modify an existing post type

There are lots of situations where a theme or plugin registers a post type and you want to modify it. There is of course add_post_type_support() and remove_post_type_support(), but those don't give access to the full list of arguments that register_post_type() takes. In particular, maybe I want to disable a post type archive, hide the admin UI, hide from search, etc. while leaving the rest of the post type settings alone.

The Codex page for register_post_type() dangles this in front of me:

Description

Create or modify a post type.

But in the past, when I've try to do this, it hasn't seemed to work. Is this function really for modifying post types, and if so, can you simply redeclare a couple arguments and leave the rest alone?

Seeing that there isn't even a deregister_post_type() function, I don't understand how it can be done.

mrwweb
  • 10.3k
  • 5
  • 40
  • 75