This entry is part 3 of 8 in the Customizing Restrict Content Pro Series
- Mail Chimp for Restrict Content Pro
- Add Custom User Meta Fields to Restrict Content Pro Registration
- Removing “Restrict This Content” Meta Box in Restrict Content Pro
- Restrict Content Pro – Campaign Monitor
- Restrict Content Pro – Graphs
- Restrict Content Pro – Stripe Payment Gateway
- Hide wp-login.php with Restrict Content Pro
- Add a Agree to Our Terms of Use Field to Restrict Content Pro
When using Restrict Content Pro, the “Restrict this Content” meta box is automatically loaded on all registered post types, but sometimes you want to remove it from certain post types. The plugin includes a simple filter that you can use to specify which post types the meta box should not be added displayed on.
For example, to remove the meta box from the “books” post type, use this:
1 2 3 4 5 6 7 8 | function pippin_exclude_post_types_from_rcp($post_types) { // we do NOT want the meta box displayed on the "books" post type $post_types[] = 'books'; return $post_types; } add_filter('rcp_metabox_excluded_post_types', 'pippin_exclude_post_types_from_rcp'); |
An array of post types is passed to the filter with the $post_types variable. All we need to do is add the name of our post type to the array, and then return the modified array.
You can set as many post types as you want to be excluded. To remove the meta box from both “books” and “page”, use this:
1 2 3 4 5 6 7 8 9 | function pippin_exclude_post_types_from_rcp($post_types) { // we do NOT want the meta box displayed on the "books" or "pages" post type $post_types[] = 'books'; $post_types[] = 'page'; return $post_types; } add_filter('rcp_metabox_excluded_post_types', 'pippin_exclude_post_types_from_rcp'); |
It’s that simple.
Related Items

Thanks. Easy peasy. Nice level of control to have.