Title: Disabling post types
Last modified: April 8, 2020

---

# Disabling post types

 *  Resolved [sunnyt13](https://wordpress.org/support/users/sunnyt13/)
 * (@sunnyt13)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/disabling-post-types/)
 * Hey there,
 * I saw this in the update notice: “Custom Post Type UI now has the ability to 
   skip content types with a WordPress filter”
 * But am not sure where to find that filter?
 * Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 2 months ago](https://wordpress.org/support/topic/disabling-post-types/#post-12643082)
 * If you’re talking about the part that I believe you are, it’d be any of these
   WordPress code filters:
 * [https://github.com/WebDevStudios/custom-post-type-ui/blob/master/custom-post-type-ui.php#L270-L294](https://github.com/WebDevStudios/custom-post-type-ui/blob/master/custom-post-type-ui.php#L270-L294)
 * [https://github.com/WebDevStudios/custom-post-type-ui/blob/master/custom-post-type-ui.php#L546-L570](https://github.com/WebDevStudios/custom-post-type-ui/blob/master/custom-post-type-ui.php#L546-L570)
 * The easiest ones to use would be the dynamic filter ones, and they can be used
   as such. Imagine you have post types of “movie” and “tv_show” and then taxonomies
   of “genre” and “directors”. For whatever reason, you want to stop having “movie”
   and “directors” registered for you, but you don’t want to delete the CPTUI settings
   because you need to bring them back at a later time.
 * You could use the following to temporarily prevent their registration:
 *     ```
       add_filter( 'cptui_disable_movie_cpt', '__return_true' );
       add_filter( 'cptui_disable_directors_tax', '__return_true' );
       ```
   
 * Basically we use a WordPress core function that simply and merely returns true,
   without having to declare your own callback. Since we’re returning true, we’re
   telling CPTUI to indeed skip these two, and move on to the next ones.
 * the other two filters shown will be a bit more general, and you’d need to check
   the current content type being iterated over with them. Seems potentially counter-
   intuitive, but they have their uses. For example those general ones could be 
   used if you wanted to prevent ALL but one. If you want an example of that, I 
   can type one up, but I think the examples above are going to be most useful to
   you out of the gate.
 *  Thread Starter [sunnyt13](https://wordpress.org/support/users/sunnyt13/)
 * (@sunnyt13)
 * [6 years, 2 months ago](https://wordpress.org/support/topic/disabling-post-types/#post-12643181)
 * Hey Michael,
 * Thanks for the quick response. Your short snippet looks to be exactly what I 
   was looking for.
 * Thanks!
 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [6 years, 2 months ago](https://wordpress.org/support/topic/disabling-post-types/#post-12643247)
 * Welcome.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Disabling post types’ is closed to new replies.

 * ![](https://ps.w.org/custom-post-type-ui/assets/icon-256x256.png?rev=2744389)
 * [Custom Post Type UI](https://wordpress.org/plugins/custom-post-type-ui/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/custom-post-type-ui/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/custom-post-type-ui/)
 * [Active Topics](https://wordpress.org/support/plugin/custom-post-type-ui/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/custom-post-type-ui/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/custom-post-type-ui/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [6 years, 2 months ago](https://wordpress.org/support/topic/disabling-post-types/#post-12643247)
 * Status: resolved