Title: Custom capability &#8211; docs?
Last modified: April 29, 2026

---

# Custom capability – docs?

 *  Resolved [p1c2d3](https://wordpress.org/support/users/postcd/)
 * (@postcd)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/custom-capability-docs/)
 * I am unable to find any easily accessible instruction on how to use custom capability
   field when editing a role. Ideally some example.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-capability-docs%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Support [Omar ElHawary](https://wordpress.org/support/users/omarelhawary/)
 * (@omarelhawary)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/custom-capability-docs/#post-18894294)
 * Hi [@postcd](https://wordpress.org/support/users/postcd/),
 * Thanks for reaching out Members Support Team!
 * The **Custom Capability** field in the role editor lets you add a capability 
   that isn’t already listed in the UI — including ones you’ve invented yourself.
 * **How to use it:**
    1. Go to **Users → Roles** and open the role you want to edit.
    2. Scroll down to the **Edit Capabilities** section.
    3. Find the **Custom Capability** text field on the **right side** of the Edit 
       Capabilities box.
    4. Type in the capability name using lowercase letters and underscores — for example:`
       view_reports` or `access_premium_content`.
    5. Select **Grant** or **Deny** using the radio buttons next to it.
    6. Save the role.
 * That capability is now assigned to the role and stored directly in your WordPress
   database.
 * **A few things to keep in mind:**
    - Capability names are case-sensitive and should use only lowercase letters,
      numbers, and underscores (e.g., `my_custom_cap`, not `My Custom Cap`).
    - A custom capability you add this way won’t _do_ anything by itself — it just
      gets stored on the role. For it to have an effect, something needs to check
      for it, either via `current_user_can( 'my_custom_cap' )` in theme/plugin code,
      or through Members’ own Content Permissions or shortcode features (e.g., `[
      members_access capability="my_custom_cap"]`).
    - Changes made here are permanent and survive plugin deactivation, since Members
      writes directly to the database.
 * Let us know if you have a specific use case in mind and we can point you in the
   right direction!
 *  Thread Starter [p1c2d3](https://wordpress.org/support/users/postcd/)
 * (@postcd)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/custom-capability-docs/#post-18894309)
 * Most of the things mentioned was not what I have asked, but this part was on 
   topic:
 * > A custom capability you add this way won’t _do_ anything by itself — it just
   > gets stored on the role. For it to have an effect, something needs to check
   > for it, either via `current_user_can( 'my_custom_cap' )` in theme/plugin code,
   > or through Members’ own Content Permissions or shortcode features (e.g., `[
   > members_access capability="my_custom_cap"]`).
 * Though this is too general for a layman to understand. Can you link/provide some
   examples? For example if i want to expose some page or post content only to a
   certain role with the custom capability, or when i want to expose WP-Admin custom
   plugin entry in the menu only to a role with this custom capability? Yes, i am
   asking stupidly, because i am not a developer.
 *  Plugin Support [Omar ElHawary](https://wordpress.org/support/users/omarelhawary/)
 * (@omarelhawary)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/custom-capability-docs/#post-18894343)
 * Hi [@postcd](https://wordpress.org/support/users/postcd/),
 * No worries, happy to clarify!
 * **To show a page or post only to a specific role:**
    1. Open the page or post in the WordPress editor.
    2. On the right side, find the **Content Permissions** box.
    3. Tick the role(s) that should be able to view it on your site, then save.
 * Users without that role will be blocked from seeing the content when they visit
   the page.
 * **To restrict a WordPress admin menu item to a specific role:**
 * Each admin menu item requires a specific capability to be visible. If a role 
   doesn’t have that capability, the menu item simply won’t appear for users with
   that role. You can use Members to grant or deny capabilities on a role to control
   this.
 * If you’re not sure which capability a particular menu item requires, let us know
   which plugin it belongs to and we can help you find it!
 * Regards,
 *  Thread Starter [p1c2d3](https://wordpress.org/support/users/postcd/)
 * (@postcd)
 * [1 month, 1 week ago](https://wordpress.org/support/topic/custom-capability-docs/#post-18894524)
 * No, I wanted to know how i can do it with custom capability. So if what i have
   mentioned can not be done with this custom capability, then please provide different
   examples how i can use it, maybe for similar objectives i have mentioned.
 *  Plugin Support [Omar ElHawary](https://wordpress.org/support/users/omarelhawary/)
 * (@omarelhawary)
 * [1 month ago](https://wordpress.org/support/topic/custom-capability-docs/#post-18896150)
 * Hi [@postcd](https://wordpress.org/support/users/postcd/),
 * Thank you for pushing back — here’s a more honest answer:
 * For a non-developer, the most practical way to use a custom capability is with
   the Members shortcode directly inside your page or post content.
 * For example, if you created a capability called `view_vip_content` and granted
   it to a role:
 * `[members_access capability="view_vip_content"]This text is only visible to users
   whose role has this capability.[/members_access]`
 * Any content you wrap in that shortcode will only be visible to users with that
   capability. Everyone else won’t see it.
 * For restricting entire pages or admin menu items using a custom capability, that
   would require a small amount of custom code — something a developer could set
   up quickly, but not something Members handles out of the box without code.
 * Sorry for the confusion in our earlier replies!

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

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fcustom-capability-docs%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/members/assets/icon-256x256.png?rev=3508404)
 * [Members - Membership & User Role Editor Plugin](https://wordpress.org/plugins/members/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/members/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/members/)
 * [Active Topics](https://wordpress.org/support/plugin/members/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/members/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/members/reviews/)

 * 5 replies
 * 2 participants
 * Last reply from: [Omar ElHawary](https://wordpress.org/support/users/omarelhawary/)
 * Last activity: [1 month ago](https://wordpress.org/support/topic/custom-capability-docs/#post-18896150)
 * Status: resolved