Title: Custom Post Type (not public)
Last modified: December 22, 2021

---

# Custom Post Type (not public)

 *  Resolved [jimbob1155](https://wordpress.org/support/users/snowcalling/)
 * (@snowcalling)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/custom-post-type-not-public/)
 * Hi there,
 * I would like to add/edit taxonomy on a custom post type which is not public.
 * Where is the setting to change the default post types to include all post types(
   not just public).
 * Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Contributor [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * (@tw2113)
 * The BenchPresser
 * [4 years, 9 months ago](https://wordpress.org/support/topic/custom-post-type-not-public/#post-15188521)
 * Hi [@snowcalling](https://wordpress.org/support/users/snowcalling/)
 * I believe this snippet should do you well for this topic. It will add a callback
   for a filter we have for the post types to display as options, and merge in the
   non-public, but NOT the post types that are built in to WordPress. That way you
   can at least get the custom private post types from your other settings in CPTUI,
   but also others coming from other plugins in case you want/need those.
 * This snippet would go in your active theme’s functions.php file, hopefully as
   a child theme. If you’d prefer a quick plugin, perhaps because you have a premium
   theme that gets regular updates, I can do that.
 * If you’d prefer to not include other plugins’ post types, I can amend this code
   to only fetch post types registered by CPTUI as well. Let me know.
 *     ```
       function cptui_support_include_non_public_post_types_for_taxonomies( $post_types, $args, $output ) {
       	$non_public = get_post_types( [
       		'public'   => false,
       		'_builtin' => false,
       	], $output );
   
       	if ( ! empty( $non_public ) ) {
       		$post_types = array_merge( $post_types, $non_public );
       	}
   
       	return $post_types;
       }
       add_filter( 'cptui_get_post_types_for_taxonomies', 'cptui_support_include_non_public_post_types_for_taxonomies' , 10, 3 );
       ```
   

Viewing 1 replies (of 1 total)

 The topic ‘Custom Post Type (not public)’ 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/)

 * 1 reply
 * 2 participants
 * Last reply from: [Michael Beckwith](https://wordpress.org/support/users/tw2113/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/custom-post-type-not-public/#post-15188521)
 * Status: resolved