Tutorial Creating a Custom User on WordPress

Posted in Tutorials

Tweet This Share on Facebook Bookmark on Delicious Digg this Submit to Reddit

In WordPress, you can create a custom user role with custom capabilities.  This tutorial will show you how to create a custom role called “writer” that can only create draft of posts and not publish anything.  This may be useful if you want to have other people write blog content, but you want to review and edit them before publishing.

WordPress already comes with 6 pre-defined roles: Super Admin, Administrator, Editor, Contributor, and Subscriber.  The “Super Admin” is only available when you turn on Network of Sites feature.   Otherwise, Super Admin and Administrator are equivalent in a single-site WordPress.  The capabilities of each role is listed in the WordPress Codex.

However sometimes you might need to create a custom role with specific capabilities combination not found in the pre-defined roles.

1. In this case, you would want to install and activated the User Role Editor plugin.

2.  After installation and activation, you will see a new menu in “Users -> User Role Editor”.

3.  After selecting the menu, click “Add Role” in the “User Role Editor”…

create custom role using user role editor

create custom role using user role editor

4.  We will create a new custom role called “Writer”.  In the dialog that comes up, type “Writer” for the ID and for the role name…

new custom role writer

new custom role writer

5.  Now we have to assign capabilities to this new custom role.  Make sure that “writer” is in the role droplist.  Let’s give writer the ability to edit and create new post drafts, but not publish them.  Do this by checkmarking “read” and “edit posts”.  And then click “Update”.

edit custom role

edit custom role

6. A dialog will popup to say “Please confirm permission update”.  Select OK and you should get a confirmation message saying “Role is updated successfully”.

To Use the New Custom Role

1.  In the WordPress Dashboard, go to Users -> Add New.

2.  Fill out username and password and set the “role” to your new custom role of “writer”.  Click button “Add new user”.

3.  The new user can log in.   You will notice that with this custom role, the WordPress dashboard is very simplified.  There is no “Pages” menu, so user can not edit or create pages.   And when this user goes to write a new post, there is no publish button.  Only a “Submit for Review” button.

custom role has simplified dashboard

custom role has simplified dashboard

4. And while the custom role can view all other posts, it can only edit its own posts.  The other posts has only the “view” link and not the “edit” link.   There is also a filter link titled “Mine” that would only show the user’s specific posts.

custom role can edit own posts

custom role can edit own posts

5.  To have this post published, an user with publish capabilities needs to log in, edit post, and click the publish button.