Selecting a role when registering a WordPress user. Plugin for WordPress - “User Role Editor”. How to Add a New User Role in WordPress

The user system in WordPress can seem quite confusing at first. However, to be effective when creating users and defining their capabilities, you need to understand what roles there are. There are different types of users in WordPress. WordPress offers the following default roles: Administrator, Editor, Author, Participant, Subscriber. You can also add a user and assign your roles to him. A role defines what a user is allowed to do.

You need to be careful when assigning roles to users. This is important because some users may have more rights to your blog than you intended. For example, some roles allow a user to delete a blog, its content, or part of its content without it being considered a prohibited action. Therefore, there is a golden rule - you need to go through all the roles and match them with the most suitable user.

What is the real value of such roles is that each role is assigned some rights, and without rights it is just a name without real capabilities. For example, administrators and editors have more rights than subscribers, authors, and contributors. You can also change some rights in a role, create a new role and configure rights without plugins. WordPress Plugin API includes adding, deleting, and changing roles and rights.

In general, there are six main roles that you can choose from. The list presented here starts with the highest access level and gradually moves down to the lowest access level. For example, we first wrote Super Administrator, which means they have rights to all the capabilities listed in their role, as well as everything written for the five below. These roles can be used by default, but can also be changed.

Standard installation

With a standard WordPress installation there is 6 roles (or 5 , if you only have one website under management). Roles provide several combinations of rights assigned to a user.

Super Administrator
(Super Administrator)

This is a role with maximum opportunity. Super administrator can manage multiple blogs from one domain and can see the entire network. He is also known as Network Administrator, he is responsible for themes, network users, network settings and the site in general.

They have access to the administration of the blog network. They can use the Network Administrator panel to view and manage the different sites that are part of the network. Also, the super administrator has access to the themes and settings of all network sites. Using the section " Adding new sites" they can add new sites to the network. Using the panel " Admin Themes" super administrator can manage the themes that are used on each site. They can activate and deactivate the themes used by the site or network. When they disable one theme, it can remain selected, and if another theme is selected, the disabled theme will be deleted. It is better to reserve this one role for website owners, editors-in-chief and webmasters.

1. Administrator
(Administrator)

In the case of a network of sites, the Administrator is the second in command of the super administrator. In case you have only one site to manage, Administrator will be the main one, since there is no need for network settings and super administrator rights. An individual site administrator manages themes, users, and plugins and updates them as needed, as well as edits and imports or exports data through the console. The administrator role may differ between a single site and a network of sites. However, all administrators have the following rights:

Activating plugins, creating users, deleting other users' pages, deleting plugins and posts or private pages or posts, they can also delete a published page. Deleting or creating users, editing the console, files, pages, posts, private pages, published pages and posts, editing themes and features. They have rights to export and import content, as well as manage categories, links and options. The administrator can moderate comments. They can publish and read private pages and change themes, as well as download files.

The administrator of individual sites has additional capabilities, which in the case of a network of sites are only available Super Administrators. This includes updating the core, plugins and themes, as well as installing, uninstalling, editing themes and plugins, and editing users.

2. Editor
(Editor)

This role is below Administrator. The role of an editor is something similar to that of a newspaper or magazine editor. They can edit content and create new content. They can also moderate comments and respond to comments. They have the right to edit categories and links. In the case where this is not a network, but a separate site, the editor is also responsible for daily tasks.

An editor can delete the pages, posts and private pages of others, as well as posts and published posts. They can also edit other people's posts, pages, private posts and published pages. They can manage categories, links and moderate comments. They have the right to publish pages and posts, as well as read private posts and pages and download files.

3. Author
(Author)

An author is also a person who can create, manage, and publish content. However, the author cannot create pages blog or website, and recordings only. It is necessary to clearly understand the difference between an author and an editor. An author can only make changes to their own content, while an editor can edit their own content as well as the content of any other author. Authors also have the rights to upload images, files and any materials to the site or blog. The author can delete published posts and delete posts. They can read posts and download files.

4. Participant
(Contributor)

Contributor is a role that allows you to add new content. They have access to a specific part of the console. This is usually the section " Adding a new entry". And although they have the opportunity and rights to add their content, they cannot publish it directly, since publication must be done by the author or editor after they have reviewed the participant's work. The participant can edit and delete their drafts and read the rest of the entries.

Do you have guest posts? If yes, then the Contributor role in WordPress will be very useful for you. This is the best role for guest posts because the author's role includes publishing and reviewing posts, and you don't want to give those opportunities to guests. Participant can't add images to the entry. But they can add images using HTML code that links to an image posted elsewhere. Participants can also see entries in the console. If this is a person you trust, you can also give him or her more rights. They may even host guest posts on your blog, but if that person writes you one guest post, it's best to stick with the Contributor role.

5. Subscriber
(Subscriber)

The audience of a website or blog is subscribers. Without registration they cannot do anything. Once they have registered, they have access to the site's content and can even comment. But they cannot make any changes to the content. But you can allow subscribers to see private posts and pages without additional plugins or code.

Conclusion

User roles are an integral part of a standard WordPress installation. Roles make it easy to create different types of users, which can be used in both standard and modified form. By default, there are roles: Super Administrator, Administrator, Editor, Author, Contributor and Subscriber. User roles and rights are very important, especially if there are many people working on the site. This makes the site more manageable, reliable and efficient.

Greetings to all dear blog users. Not everyone knows about the capabilities of the WordPress admin panel. Despite the fact that he has been blogging for a year or more. The article is dedicated to this very topic; it will be very useful both for beginners and for those bloggers who do not fully understand the entire structure of the platform.

Let's start by explaining the concept of "USER". That is, who is this in general, what kind of site management users can there be and what responsibilities are assigned to each of them, as well as why user roles were created on WordPress.

I think we can figure this out quite simply, so let’s not delay and get started!

Why are roles created for WordPress users?

Probably in order to delegate blogging tasks, mainly publishing new entries, so-called posts, articles.

As for users, this function was specially created so that the blog or website is run by people who have a clear responsibility, each with their own business.

What does it mean?

And the fact that on the WordPress platform you can add a new user for a more simplified work with your blog.

What types of WordPress users are there and their responsibilities?

Now in more detail about each of them.

A subscriber is, in essence, the same reader who can own information like any other visitor. If you have a registration process on your site, then this is just the point. A subscriber can be a registered user.

Participant - his rights are also greatly limited. There are no such responsibilities. Editing, deleting drafts, that's all the participant can do. More profound requirements can be seen in the author.

Author - has the right to add new entries, save, view and publish them. It is also possible to add pictures and many other media files. But sometimes there are problems with video insertion and tricks with placing codes.

Editor - its range of capabilities is very wide. Unlike the author, the editor has the full right to publish and remove all blog entries from publication. The editor also has the right to moderate pending comments, add new pages, categories, and delete links.

Well, the very last user is the administrator. Who is this and what rights does he have? This is the person who owns all rights to work with the blog.

It can play the role of all participants, users on the site and even more. The administrator has the ability to add new plugins, activate them and deactivate them. The administrator has the right to climb into the source code of the template, the site itself, correct it, add new widgets, delete old ones, he can do all this.

In general, the design, template replacement, adding and deleting new users and all other settings can be carried out by the admin. Guys, I think that almost each of you has one admin and that’s it. Maybe I'm wrong, but most likely things are this way.

Looks like this has been sorted out. But still one thing was not taken into account. Exactly, I did not mark the super administrator in the list of users. You cannot add it, since this is the owner of the site, or rather sites. Super administrator, or in other words, network administrator manages several blogs from one platform.

The network administrator can select a simple admin, just like all other participants. Or there is an opportunity to simply give him the password and username of one resource and let him carry out full work on it.

Now we will deal with another issue.

How can you pressure a new user on WordPress?

This question may interest you at some point in your blogging. For example, when you earn enough for your blog to be filled with content by some other person, for example, a copywriter. You add him as an author and he calmly writes articles for the site. You receive payment and verification of new entries.

So, you can add a new member by going to the admin panel of your blog. Then you go to the "Users" section. It is located almost at the very bottom.

We go there and get to a page where you must click “Add new”. If you have not carried out any actions before, then there will be only one admin who does all the work. We are adding a new user to ease the difficult burden of blogging.

After you click add a new one, you need to enter his details. It looks like this:

However, you will figure it out as you go.

Fill in the fields. We write down the username, email, password, which you can’t necessarily miss. I believe that it is better to fully approach the idea of ​​a new participant. This is not a robot, so we indicate the first name and last name, if there is a website, then we insert it. I think it's clear.

You now have a new user. Yes, this should be treated with caution. Before adding someone, you should check them. For example, if it is the author, then let him provide an article on the topic that you indicate; if it is the editor, then you must know this person, because the work is responsible and requires the right approach. The main thing is that the person did not have bad goals. After all, there are ill-wishers who want to do harm.

You can talk about adding an admin in silence, because judge for yourself, giving your entire blog to a stranger is not always reliable. Therefore, it is better to blog yourself. If you trust someone, you can give it to him, but trust alone is not enough, it is important to know whether the user can cope with this responsible work or not.

Well, that's all I would like to tell you in this article. I hope the information was useful. Until we meet again, friends.

Sincerely, Zhuk Yuri

Do you want to add multiple authors to your blog? WordPress comes with a built-in user management system that allows you to add users with different roles and capabilities, allowing you to add new users without worrying about the security of your site. In this article, we will show you how to add new users and authors to your WordPress blog.

Adding a new user to your WordPress site.

There are two ways to add new users to your WordPress site. You can open user registration on your WordPress site, or you can add them manually. The first method will allow any user to create an account on your site. This method is useful when you want to invite many people to join your community. However, if you just want to add a few users, you must add them manually.

To add a new user to your WordPress site, simply select the “Users” -> “Add New” tab and fill out the form.

First you need to specify the name of the user you are adding. This name is requiredremember, you need it to log in. The name can be anything, tit all depends on your imagination.

Then you need to enter the user's email address. It's better to provide a real email address, if you lose your password, this will help you recover it.

You can enter your first name, last name, and website information.However, these fields are optional, and users can edit them themselves if the need arises.

The next element in the form is to select a password.You should use a strong password to help keep your site secure.You can use a password generator on the Internet.Below the password fields you will see a checkbox, you can check the box to send the password to the user via email.The user will receive their registration information via the email address provided above. You can also start entering your password, and if it is “weak”, then the “Confirm password” item will appear below, you can check the box that will allow the use of a weak password.

The last field is to select the user role.Each user role has different capabilities.The subscriber has the lowest privileges, while the administrator has the most advanced.You need to choose a role based on what tasks the user will be performing on your website.

Understanding User Roles in WordPress

WordPress comes with these roles by default:

  1. Administrator
  2. Editor
  3. Participant
  4. Author
  5. Subscriber

An administrator can perform all tasks on your WordPress site.It is strongly recommended not to assign this role to an unknown user unless you trust them.With the administrator role, the user can install plugins, change themes, delete content, other users, including other administrators.

If you simply want to allow the user to add posts and edit them, you can use the Contributor or Author roles.Users with the Contributor or Author role can write messages, but cannot publish them.They cannot edit other users' posts and cannot access other admin options such as plugins, themes, settings, tools, and so on.

On the other hand, if you want someone to not only add messages, but also publish them, then the author role is ideal for this situation.Users with the Author role can add, edit, and publish their own posts.

To give the user full control over the articles on your website, you can give them the editor role.Users with the editor role can add, edit, publish, delete their own messages, as well as messages from all other users.They cannot access website settings, plugins, themes, and so on.

A subscriber can simply maintain their own profile on your site and cannot write messages.It is typically used on sites where users must register to post comments or upload content.

User Management in WordPress

Since you are an administrator, you can add and remove users from your WordPress site at any time. You can also edit your user profile at any time and change any information, including passwords. Simply click on Users and edit or delete a user at any time.

For more adventurous users, there are other options, such as plugins, where you can extend and customize the functionality of your WordPress user management system. You can add or remove capabilities for different user roles, or create your own roles. You can add additional fields to user profiles, add an author bio, display a list of authors, and so on.

I hope this article helps you learn how to add new users and authors to your WordPress site.

WordPress has a mechanism of roles and capabilities, or, in other words, user groups and their rights in order to control the behavior of users on the site, especially in the administrative part.

For example, “Administrators” is a user group, and switch_themes (the ability to change the theme) already refers to the rights of this group.

As usual, I'll start from simple to complex.

1. Roles

WordPress already has 6 user groups by default:

  • Super Admin is a super administrator who has the right to manage a network of sites.
  • Administrator - administrator.
  • Editor - editor, can publish and edit posts of other users.
  • Author - author, can publish and edit his own posts.
  • Contributor is a participant who can write and submit his posts for moderation.
  • Subscriber - a subscriber, all he can do is edit his profile.

Immediately after installing WordPress, an administrator user is automatically created.

You can also set which role should be assigned to the newly registered user. This is configured in Settings > General.

You can change a user's role on his profile page or on the page with all users:

2. Opportunities

In the table, to save space, I did not consider the roles of super administrator and subscriber. A superadmin is essentially the same administrator, only with rights to manage a network of sites (WordPress Multisite). I’ll write more about him below. But I won’t write about subscribers, since everything about them is already clear - they have only one read option.

Opportunity Admin Editor Author Contributor
Plugins
install_plugins installation of new plugins +
update_plugins update plugins +
activate_plugins gives access to the plugins page +
edit_plugins ability to edit plugin files +
delete_plugins deleting plugins +
Themes
install_themes installation of new themes +
switch_themes change the active theme +
edit_themes edit theme files +
edit_theme_options change theme settings +
update_themes update themes +
delete_themes delete themes +
WordPress Settings
update_core engine update +
import / export ability to use import and export functions +
manage_options change site settings +
edit_dashboard changes to console page +
Users
create_users creating new users +
edit_users editing users +
delete_users deleting users +
list_users access to the list of users +
promote_users change user roles +
remove_users removing users +
Comments
moderate_comments comment moderation + +
Categories
manage_categories change categories + +
Pages
edit_pages editing pages + +
edit_others_pages editing pages created by other editors + +
edit_published_pages editing published pages + +
publish_pages publish pages + +
delete_pages delete pages + +
delete_others_pages delete other users' pages + +
delete_published_pages delete published pages + +
delete_private_pages deleting personal pages + +
edit_private_pages editing personal pages + +
read_private_pages view personal pages + +
Posts
edit_others_posts editing posts of other users + +
delete_others_posts deletes posts by other users + +
delete_private_posts deleting posts marked as “Private” + +
edit_private_posts editing personal posts + +
read_private_posts view private posts + +
edit_published_posts edit your own published posts + + +
publish_posts publishing posts + + +
delete_published_posts deleting your own published posts + + +
edit_posts editing your own posts + + + +
delete_posts deleting your own posts + + + +
Other
unfiltered_html ability to insert HTML and JavaScript into posts, pages, comments and widgets + +
+ + +
read site viewing + + + +

As promised, I’ll dwell a little more on superadministrators. Regular administrators have full rights to manage their sites. Super administrators can manage any site on the network, as well as the entire network as a whole.

They have several features of their own:

  • manage_network gives access to the network console,
  • manage_sites access to the network sites management page,
  • manage_network_users ability to manage network users,
  • manage_network_themes manage network themes,
  • manage_network_options access to network parameters;

3. Levels

As of WordPress 3.0, user levels are no longer used!

4. Functions for working with user roles and capabilities

add_role() - create your own role

The function enters data into the database, so it is best to use it only once, for example when activating a plugin or theme.

/* * let’s say I add this code to the plugin file and make it run when this plugin is activated */ register_activation_hook( __FILE__ , "true_new_role_plugin_activate") ; function true_new_role_plugin_activate() ( $new_role = add_role( "comm_moderator" , // role name __( "Comment Moderator" ) , // display role name (comment moderator) array ( // array of possibilities, true - allowed, false - prohibited"read" => true , // well, that's clear "moderate_comments" => true // allow moderation of comments) ) ; if ( null !== $result ) ( // look at the result // role created successfully) else ( // if null, then the role already exists } }

remove_role() - removing roles

Just like add_role() , the function changes the contents of the database - which means you don’t need to just stupidly insert it into functions.php .

In the example, we will delete the role created in the last chapter:

get_role() — getting information about a user group

If successful, returns a WP_Role object (which consists primarily of the role's capabilities); if unsuccessful, returns null.

add_cap() and remove_cap() - adding and removing capabilities

With these features, you can add or remove rights for users of a specific role or even for users with specific IDs.

These functions also modify the contents of the database, so as an example we will hang them on activating/deactivating a theme.

function true_author_caps() ( global $pagenow ; $role = get_role( "author" ) ; // for example, take the role of the author // $role = new WP_User($user_id); this way we can take a specific user if ( "themes.php" == $pagenow && isset ( $_GET [ "activated" ] ) ) ( // if the theme has been activated$role ->add_cap ( "edit_others_posts" ) ; // allow authors to edit posts of other authors) else ( // if the theme is deactivated$role ->remove_cap ( "edit_others_posts" ) ; ) ) add_action ( "load-themes.php" , "true_author_caps" ) ; // hang the function on a hook

If you need help with your website or maybe even development from scratch - .

Hello! We continue to analyze the most interesting and most useful plugins for the WordPress site! Today you will learn how to create a new user role on your website. You will be able to add new roles, you will be able to edit existing roles. You will be able to change the capabilities of the user role. Very simple and useful plugin!

You can install the plugin directly from the WordPress admin panel. Go to page: Plugins – Add new , enter the name of the plugin in the search form, press Enter, install and activate the plugin.

Next, after installing and activating the plugin, go to the page: Roles. Here you will see all the roles of your site. You can change the role's capabilities by clicking on the tab “Edit” or “View”.

On the edit role page, you can change the capabilities of the user role. For example, you can allow or prohibit the publication of posts, or editing posts, etc. All features are listed in the section "Capabilities".

You can copy the capabilities of another role in the field “Copy from”. After the change, update the role – Update Role.

To add a new role, go to page – Add New Role. Specify the role name, role capabilities and click on the button below - Add a new role.

– Role, select the user role.

– Priority, you can specify the priority.

– URL, specify the URL to which the user will be redirected after entering the site.

– Deny WP-ADMIN, do not show the WordPress admin panel.

– Disable Toolbar, do not show the toolbar.

– At the end, click on the button – Submit.

Display Deprecated Capabilities, display outdated features.

Remove Non-Standard Capabilities on Restore, remove non-standard recovery options.

– Override Edit Permissions, cancel editing permissions and access rights.

Disable Navigation Menu Permissions, disable the permissions menu.

Override Navigation Menu Permissions, redefine permissions.

– Remove Data on Uninstall, remove all plugin data from the database. Enable this option if you are deleting this plugin.

Save your changes.

All is ready! After saving the settings, all changes will take effect.