Back to Community

Why Your Custom Post Types Don't Show in Members Plugin (And How To Fix It)

Content

If you're using the 'Members – Membership & User Role Editor Plugin' and your custom post types (CPTs) aren't appearing in the role editor, you're not alone. This is a common point of confusion that stems from how WordPress handles capabilities for custom content. This guide will explain why this happens and walk you through the most effective solutions.

The Core Issue: Capability Registration

The Members plugin dynamically reads and displays capabilities that exist within your WordPress installation. It does not automatically create capabilities for every custom post type. For a CPT to appear as a dedicated, nicely-formatted section in the role editor (like 'Posts' or 'Pages'), it must be registered with its own unique set of capabilities.

Many plugins and methods for creating CPTs (like ACF Pro, Pods, or manual code) do not define a custom capability_type by default. Instead, they often fall back to the standard 'post' capabilities (edit_posts, publish_posts, etc.). Since these are generic post capabilities, Members has no way to distinguish them for your specific CPT.

How to Fix It: The Two Main Solutions

Solution 1: Modify Your CPT Registration Code (For Programmatically Created CPTs)

If you registered your CPT in your theme's functions.php file or a custom plugin, you need to add two key arguments to the $args array when using register_post_type().

$args = array(
    // ... your other arguments ...
    'capability_type' => 'event', // Singular name of your CPT
    'map_meta_cap'    => true, // Crucial for enforcing meta capabilities
);

register_post_type( 'event', $args );

What this does: The capability_type argument tells WordPress to create unique capabilities for this post type (e.g., edit_events, publish_events, delete_events). The map_meta_cap argument enables WordPress to correctly map high-level permissions (like 'edit_post') to these new primitive capabilities.

After adding this code and refreshing your site, the new capabilities will be generated. You should then see a new section for your CPT (e.g., 'Events') in the Members role editor.

Solution 2: Use the Built-in Feature in Your CPT Plugin

Many popular CPT creation tools have an option to enable custom capabilities.

  • Advanced Custom Fields (ACF) Pro: When creating or editing a post type in ACF, navigate to the 'Permissions' tab and enable the 'Rename Capabilities' option. This will automatically generate the necessary custom capabilities for you.
  • Pods: Ensure that your pod is configured to use its own capabilities rather than the default WordPress ones. The interface for this may vary depending on your Pods version.

After enabling this option in your respective plugin, the capabilities will be created, and the CPT should appear in the Members interface after a page refresh.

Troubleshooting Other Common Scenarios

  • Taxonomies Not Visible: The ability to assign terms from a custom taxonomy often requires the manage_categories capability by default. If a user role cannot assign terms, check that this capability (or a custom one defined by the taxonomy) is granted.
  • Admin Menu Issues: If a user with multiple roles can't see a specific CPT admin menu item, it's often a conflict with another plugin or theme that manages admin menus. A standard troubleshooting step is to disable all other plugins temporarily to identify the conflict.
  • Content Shows a 404 Instead of a Restriction Message: This can sometimes be caused by aggressive caching. Clear your site's cache (both plugin and server-level) to see if that resolves the issue.

When These Solutions Don't Apply

It's important to note that the Members plugin controls access based on capabilities, not directly on post types. Some plugins do not create their own capabilities and instead rely on native administrator-level capabilities like manage_options. In these cases, you cannot restrict access to that plugin's features without also granting powerful administrator privileges. For such plugins, your best course of action is to contact the plugin's author and request they implement custom capabilities for better access control.

By ensuring your custom post types are registered with their own capabilities, you unlock the full potential of the Members plugin for managing access to your site's unique content.

Related Support Threads Support