- Guide
- Intermediate
- 5 minutes read
- Reviewed August 5, 2026
- WordPress users, roles and permissions
A WordPress capability is a named permission representing an action that a user may be allowed to perform.
Examples include edit_posts, publish_posts, manage_options, edit_users and update_plugins. Roles group capabilities, but the capability is the unit WordPress checks when deciding whether access should be granted.
Capabilities Protect Actions
A menu item may be hidden when a user lacks a capability, but interface visibility is not the security control by itself.
The protected action must also verify permission on the server. A user should not gain access merely by sending a request directly to an administration URL or API endpoint.
In custom code, current_user_can() is commonly used to check whether the current user may perform an action.
Primitive and Meta Capabilities
WordPress capabilities can be understood in two broad groups.
Primitive capabilities are stored on roles or users, such as edit_posts or edit_others_posts.
Meta capabilities describe a contextual action, such as editing a specific post or user. WordPress maps that request to the primitive capabilities required in the current situation.
For example, permission to edit one post may depend on:
- The post type.
- The post author.
- The post status.
- Whether the user can edit other users' content.
- Whether the post has already been published.
Contextual checks are more accurate than testing a broad capability without the relevant object ID.
Content Capabilities
Post types use capability mappings to control actions including:
- Creating content.
- Editing own content.
- Editing other users' content.
- Publishing.
- Deleting.
- Reading private content.
Custom post types can reuse the standard post capability model or register a distinct set. A distinct model is useful when access to the custom content should differ from ordinary posts.
Administrative Capabilities
High-impact capabilities include actions such as managing options, installing software, editing users or updating core.
These permissions should remain limited because they can change the operation or security of the entire site.
A user who needs one configuration screen should not automatically receive every administrative capability. A plugin can protect its settings with a purpose-specific capability.
User-Specific Capabilities
WordPress can store capabilities directly on an individual user as well as through roles.
Direct assignments are powerful but harder to audit. A user may behave differently from others with the same role, and future administrators may not understand why.
Prefer role-based or clearly documented permission models unless an individual exception is genuinely required.
Capability Names Are Part of an Interface
Custom capability names should be:
- Stable.
- Specific to an action.
- Consistently prefixed when appropriate.
- Documented for administrators and developers.
- Added and removed through controlled lifecycle logic.
Changing a capability name can break access rules, saved roles and integrations.
Check Capabilities, Not Role Names
Code should normally ask whether a user can perform the required action, not whether the user is an Administrator or Editor.
Checking roles directly is fragile because:
- Roles can be customized.
- Custom roles may share the required capability.
- Multisite changes some administrative boundaries.
- One user can have permissions beyond a single role model.
Capability checks describe the actual security requirement.
Capabilities Do Not Replace Other Security Controls
Permission checks should be combined with:
- Nonces for request intent in appropriate browser actions.
- Validation and sanitization of input.
- Authentication.
- Object-level authorization.
- Secure output handling.
A nonce does not prove that a user has permission, and a capability check does not validate submitted data.
Frequently Asked Questions
Is a capability the same as a role?
No. A role is a named collection of capabilities. A capability represents an allowed action.
Can plugins add capabilities?
Yes. Plugins commonly register custom capabilities or add them to roles during controlled setup.
Why can two users with the same role behave differently?
Plugins may modify the role, assign capabilities directly to one user or apply contextual permission filters.
Applying WordPress Capabilities Explained in a Real WordPress Project
Assign access from responsibilities and capabilities rather than job title or convenience. Use named accounts, least privilege, clear recovery ownership and a documented process for reviewing and removing access.
A connected concept is Roles and Capabilities for Custom Content. Reading the two together helps separate the immediate task from the wider WordPress responsibility.
A useful implementation begins by writing down the current state, the intended outcome and the evidence that will prove the change worked. This prevents a configuration screen, plugin recommendation or code snippet from becoming the entire strategy.
A Practical Example
Imagine a team making this decision for a production WordPress site. The useful question is not only “Can WordPress do this?” but “Which layer owns it, who maintains it, what data does it affect and how will we verify it after an update?”
Write the answer in operational terms. Name the content, user, setting, file, API or service involved. Then identify what should remain true if the theme changes, a plugin is replaced or the site is migrated.
Questions to Ask
- What user or system problem does this solve?
- Which WordPress layer owns the behaviour?
- What data is created or changed?
- Who may perform the action?
- What can fail, and how will that failure be visible?
- How is the result tested after updates?
- What is the migration or removal path?
Test Capabilities, Not Labels
Role names are useful for administration, but secure code should normally test the capability required for the action. Plugins can change role definitions, and Multisite introduces additional network context.
Create test accounts with realistic permissions and verify both the interface and direct requests. Hiding a menu item does not protect the underlying operation.
Official Reference Context
The WordPress Abilities API is the primary version-specific reference for this topic. Use the current documentation to verify interface labels, supported APIs and behaviour before applying instructions to a production site.
How to Verify the Result
- Sign in with a test account for each important role.
- Confirm both visible menus and direct permission checks.
- Review account recovery, session revocation and offboarding.
Related Articles
- Roles and Capabilities for Custom Content
- How Roles and Capabilities Work Together
- Roles, Capabilities and Access Control
- Creating Custom Roles and Capabilities
Sources and Further Reading
- WordPress Abilities API
- WordPress Documentation
- WordPress Roles and Capabilities
- WordPress 7.0 Field Guide