Title: restrict custom post type?
Last modified: September 29, 2016

---

# restrict custom post type?

 *  Resolved [daybo](https://wordpress.org/support/users/daybo/)
 * (@daybo)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/)
 * Hi,
 * I read that I can restrict access to custom post types – but I have no idea how
   to do that. I can see the extra meta box on the “page” post type, but how can
   I include that meta box, on a custom post type?
 * Thanks
    David

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

 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/#post-8234981)
 * David,
 * It should be shown on all custom post types automatically. If it’s not showing,
   it could be an incompatibility with the plugin that post type comes from.
 * Can you tell me a bit more about the post type? What plugin does it come from?
 *  Thread Starter [daybo](https://wordpress.org/support/users/daybo/)
 * (@daybo)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/#post-8236984)
 * Hi Pippin,
 * The custom post type is one I have created – it is very simple. The plugin just
   declares the custom post type and that is it.
 * This is the plugin:
 * function create_survey() {
    register_post_type( ‘survey’, array( ‘labels’ => 
   array( ‘name’ => ‘Surveys’, ‘singular_name’ => ‘Survey’, ‘add_new’ => ‘Add New’,‘
   add_new_item’ => ‘Add New Survey’, ‘edit’ => ‘Edit’, ‘edit_item’ => ‘Edit Survey’,‘
   new_item’ => ‘New Survey’, ‘view’ => ‘View’, ‘view_item’ => ‘View Survey’, ‘search_items’
   => ‘Search Surveys’, ‘not_found’ => ‘No Surveys found’, ‘not_found_in_trash’ 
   => ‘No Surveys found in Trash’, ‘parent’ => ‘Parent Survey’ ),
 *  ‘public’ => false,
    ‘publicly_queriable’ => false, ‘show_ui’ => true, ‘exclude_from_search’
   => true, ‘show_in_nav_menus’ => false, ‘has_archive’ => false, ‘rewrite’ => false,‘
   menu_position’ => 15, ‘supports’ => array( ‘title’, ‘editor’), ‘taxonomies’ =
   > array( ” ), ‘menu_icon’ => ‘dashicons-clipboard’, ) ); }
 * add_action( ‘init’, ‘create_survey’ );
 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/#post-8245148)
 * Change `publicly_queriable` to `true`
 *  Thread Starter [daybo](https://wordpress.org/support/users/daybo/)
 * (@daybo)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/#post-8253323)
 * Hi Pippin,
 * Thanks for the suggestion, but sadly that has had no effect. I still cannot see
   any meta box allowing me to restrict access on the CPT.
 * Any other ideas?
 * Thanks
    David
 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/#post-8272943)
 * Does the box show up but not save?
 * Try it with all other plugins deactivated. Does it work then? If so, reactivate
   the plugins one by one until the problem comes back.
 *  [John Parris](https://wordpress.org/support/users/mindctrl/)
 * (@mindctrl)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/#post-8272955)
 * Also I believe the argument is spelled `publicly_queryable`… `y` and not `i`.
 *  Thread Starter [daybo](https://wordpress.org/support/users/daybo/)
 * (@daybo)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/#post-8273616)
 * I thought you might have had it there with the misspelling, but that wasn’t it.
   It wasn’t a plugin conflict either…but I did find what it was for anyone else
   who comes across this. It isn’t `'publicly_queryable'=>true` it is actually `'
   public'=>true`. With that set it shows the meta box whether publicly_queryable
   is true or false.
 * Thanks for your help tracking down the problem.
 * Regards
    David
    -  This reply was modified 9 years, 7 months ago by [daybo](https://wordpress.org/support/users/daybo/).
      Reason: spelling
 *  Moderator [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * (@mordauk)
 * [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/#post-8276324)
 * Ah! Thanks for sharing!

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

The topic ‘restrict custom post type?’ is closed to new replies.

 * ![](https://ps.w.org/restrict-content/assets/icon.svg?rev=3529325)
 * [Membership Plugin - Kadence Memberships](https://wordpress.org/plugins/restrict-content/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/restrict-content/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/restrict-content/)
 * [Active Topics](https://wordpress.org/support/plugin/restrict-content/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/restrict-content/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/restrict-content/reviews/)

## Tags

 * [custom post type](https://wordpress.org/support/topic-tag/custom-post-type/)

 * 8 replies
 * 3 participants
 * Last reply from: [Pippin Williamson](https://wordpress.org/support/users/mordauk/)
 * Last activity: [9 years, 7 months ago](https://wordpress.org/support/topic/restrict-custom-post-type/#post-8276324)
 * Status: resolved