You should to remove a capability named ‘manage_categories’ from user role or roles, for example:
/**
* Don't let subscribers add/edit/remove categories.
*
* You should call the function once when your plugin or theme is activated.
*
* @uses WP_Role::remove_cap()
*/
function remove_subscribers_manage_categories() {
// get_role returns an instance of WP_Role.
$role = get_role( 'subscriber' );
$role->remove_cap( 'manage_categories' );
}
Related Posts:
- How can I hide a category from Contributors in the edit/add new post screen?
- Assigning a category to a user role
- Allow contributors to add categories, but not delete
- WordPress/Woocommerce only show category in shop to a single role
- Admin comments and user restrictions
- Display posts of certain categories to specific user roles
- How to restrict category creation to admins only while allowing editors to still pick category
- Allow Custom Role to edit a custom post type category
- Display the articles of a category by role
- How can I restrict the categories users can post in, based on user roles?
- how to Specifies an author / editor to edit one category only?
- Assign a category by user and customize the edit-tags.php?taxonomy=category page
- Hide categories from authors
- How to create an automatic MultiColoumn MegaMenu with Categories WordPress
- Is There a Difference Between Taxonomies and Categories?
- Getting a List of Currently Available Roles on a WordPress Site?
- Editor can create any new user except administrator
- Is there way to rename user role name without plugin?
- List all subcategories from category
- How to create a clone role in wordpress
- How To Find Out WordPress Category Table in MYSQL?
- Add custom field to Category
- Get Category ID inside Category template
- Only one category per post
- Possible to hide Custom Post Type UI/Menu from specific User Roles?
- WordPress Multisite – global categories
- Get the children of the parent category
- Get posts from sites in Multisite?
- WP REST API: filter by category 1 AND category 2
- How to add a Capability to a User Role?
- Select subscriber as author of post in admin panel?
- How can I get a list of users by their role?
- How To Get Parent Category Slug of Current Post
- Remove Ability for Other Users to View Administrator in User List?
- Display All Products by Category with WooCommerce
- What is the difference between a “tag” and a “category”?
- How do I make a draft post accessible to everyone?
- Reset default roles and capabilities
- Is there an easy way to make a meta box have the tabs like the Categories meta box has?
- What action should I hook into when adding roles and capabilities?
- How to check if I’m on the last page of posts?
- Display posts from the same category using next/previous post link
- How would I get a taxonomy/category list inside a Gutenberg block?
- Can I set a default featured image for a category?
- Check if a post is in any child category of a parent category
- How to export and import taxonomies (category, tag and/or custom taxonomy) and their terms
- Force category choice before creating new post?
- add_role() run only once?
- Custom post type role permissions won’t let me read
- what’s the meaning of the field wp_capabilities in table wp_usermeta
- Gutenberg editor add a custom category as wrapper for custom blocks
- Allowing custom role access to custom post type in back end
- WordPress SEO by Yoast: Hide Meta Boxes in Posts for Non-admins
- WooCommerce: List All Categories
- How to get category and archive title?
- Get category ID from category slug (not working)
- How do I remove “Uncategorized” from posts with more than 1 category?
- Get rid of WordPress category, tag and author archives?
- Individual rss feed entry length for categories?
- How can I create a category landing page followed by pages of posts?
- Remove parent category from permalink? Basically only have the child category?
- Groups of capabilities: users with multiple roles?
- User-edit role setting distinct from wp_capabilities? [closed]
- Custom permalink structure leads to be 404 on pagination
- Retrieve Product category ‘NAME’ by product category ID – WooCommerce?
- What do unfiltered_html and unfiltered_upload actually filter?
- Posts URL structure like site.com/category/the-post-title
- Can’t custom taxonomies have same terms (slugs) as categories?
- How to get permalinks with category base working with sub-categories
- How to remove the term “category” from category pagination?
- Using wp_category_checklist in a widget
- Allow Editors to edit pending posts but not draft ones
- What’s the difference between Role and Meta capabilities; When to use map_meta_cap() filter
- WP 3.9 TinyMCE no longer loads on category description editor
- On the category page, get the category object
- Get only the top level categories using get_categories() without foreach loop
- Get all categories and posts in those categories
- How to add featured image for category (without a plugin)?
- How to create a custom sort for WordPress categories
- How to display non-hierarchical taxonomy as terms with checkboxes?
- Temporary capability for current_user_can()
- Category archive by year with permalink support /category/YYYY
- Best Way to Redirect Category to Page and Hide Category
- get_terms vs. get_categories: does it matter?
- What is a good robots.txt?
- Allow users to create their own feed from selected categories?
- Hook when category is added to post
- get_categories for custom post type with a specific custom taxonomy attached
- Add a URL prefix to permalinks of one category of posts only
- How do you add categories to custom post types in WordPress?
- Create a category list page
- Allow user to “edit_others_posts” to save only, not publish
- Catch 404 after changing permalink structure from /%postname%/ to /%category%/%postname%/
- Woocommerce get category image full size
- exclude category from get_posts?
- Allow roles below admin to add subscribers only
- How to let contributors to create a new revision(draft) editing their published posts
- How To Modify The Loop in archives.php To Have 11 Posts Per Page and CSS Styling
- Disallowing Users of a Custom Role from Deleting or Adding Administrators?
- Order get_terms() By Custom Field