{"id":135861,"date":"2015-01-04T08:00:53","date_gmt":"2015-01-04T13:00:53","guid":{"rendered":"http:\/\/premium.wpmudev.org\/blog\/?p=135861"},"modified":"2015-07-31T03:49:20","modified_gmt":"2015-07-31T07:49:20","slug":"change-wordpress-role-names","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/change-wordpress-role-names\/","title":{"rendered":"How to Change the Default WordPress Role Names to Anything"},"content":{"rendered":"<p>WordPress offers five default roles &#8211; Admin, Editor, Author, Contributor and Subscriber \u2013 which control what users can and cannot do on a website, such as writing and approving content, plugin and theme management and administrative tasks.<\/p>\n<p>Unfortunately, WordPress doesn\u2019t allow you to change the names of the user roles. Luckily, there\u2019s an easy fix for this.<\/p>\n<p>In today\u2019s Weekend WordPress Project I\u2019ll show you how you can change the default role names to anything you want.<\/p>\n<h2>Customising Role Names<\/h2>\n<p>If you develop WordPress sites for clients, it can be hard trying to explain the different WordPress user roles.<\/p>\n<p>For instance, if you\u2019re working on an eCommerce site for a client and you&#8217;ve assigned them a role as a Contributor, the client may be puzzled \u2013 or even offended \u2013 that they have forked out big bucks for a website they only contribute to. Well, that\u2019s their perception, anyway.<\/p>\n<p>To change Admin, Editor, Author, Contributor and\/or Subscriber, just had the following snippet to your theme\u2019s functions.php file:<\/p>\n<pre>function wps_change_role_name() {\r\nglobal $wp_roles;\r\nif ( ! isset( $wp_roles ) )\r\n$wp_roles = new WP_Roles();\r\n$wp_roles-&gt;roles['contributor']['name'] = 'Owner';\r\n$wp_roles-&gt;role_names['contributor'] = 'Owner';\r\n}\r\nadd_action('init', 'wps_change_role_name');<\/pre>\n<p>&nbsp;<\/p>\n<p>This snippet (<a href=\"http:\/\/wpsnipp.com\/index.php\/functions-php\/change-default-role-names-administrator-editor-author-contributor-subscriber\/\" target=\"_blank\">thanks to Kevin Chard!<\/a>) will let you change any of the existing role names. For example, instead of Contributor, you could have \u201cOwner\u201d (as in the snippet example above).<\/p>\n<p>The snippet will also display within the role select menu for users.<\/p>\n<figure id=\"attachment_135862\" class=\"wp-caption aligncenter\" data-caption=\"true\"><a rel=\"lightbox[135861]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/01\/contributor-owner.png\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-135862\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2015\/01\/contributor-owner.png\" alt=\"Contributor to owner\" width=\"600\" height=\"300\" \/><\/a><figcaption class=\"wp-caption-text\">Update your user roles to anything you want.<\/figcaption><\/figure>\n<p>It\u2019s also worth noting that this snippet doesn\u2019t add a new role or permanently change the name. It also doesn\u2019t update the role\u2019s slug, so if you change Contributor to Owner, the slug will remain Contributor.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>WordPress offers five default roles, which control what users can and can&#8217;t do on a website, and you&#8217;re pretty much stuck with them. Luckily, there\u2019s an easy fix if you want to customize the role names. In today&#8217;s post we show you how.<\/p>\n","protected":false},"author":164650,"featured_media":135863,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[9798],"tutorials_categories":[],"class_list":["post-135861","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-weekend-wordpress-projects"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/135861","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/164650"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=135861"}],"version-history":[{"count":2,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/135861\/revisions"}],"predecessor-version":[{"id":144532,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/135861\/revisions\/144532"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/135863"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=135861"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=135861"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=135861"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=135861"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}