How to make editors only able to edit their own page in WordPress

Tracking down a mostly working solution for this problem took most of my day today. On the LIS website, I want certain groups/people to be able to edit their own pages of the website but not be able to edit anything else. This solution takes a couple steps.

  1. First, designate a user (or users) to the role of Editor via Users > Users. Check the box next to the user and then select “Editor” from the drop down menu.
  2. Add the code from this link to your functions.php page. Include the second bit of code in order to have all your bases covered.
  3. Download the Members plugin and install it.
  4. Go to Settings > Members Components.
  5. Check “Edit Roles” then go to to Users > Roles.
  6. Hover over Editor until “Edit” appears. Click on “Edit.”
  7. Make sure only these boxes are checked: edit pages, publish_pages, edit_published_pages, read, and upload_files
  8. Download the WP Hide Dashboard plugin.
  9. Unzip WP Hide Dashboard in your favorite text editor (I’m using Dreamweaver presently) and open the wp-hide-dashboard.php file.
  10. Follow the directions on this page to hide the “Dashboard link, Tools menu, Personal Options, and Help options from other roles besides Subscriber.” Basically, you’re changing edit_posts to manage_options. Hit save.
  11. If you can, rezip the file and then upload it via WordPress’ dashboard, otherwise you’ll have to upload the unzipped file via FTP to wp-contents/plugins.
  12. Activate as per normal.

If you can, log into the account of an editor and make sure that they can only edit the page that they’ve created. When you’re on the main page of your website logged in as an editor, the “Edit this entry” text will only appear on pages that they’ve created. Some boxes are still appearing such as “Links, Pages, and Profile” but I don’t know how to disable them yet.

8 Comments

  1. Amazing tutorial!
    All things work, but one: the editor can edit ALL the pages of the site.
    How can I force the editor to edit a SINGLE page?
    Thanks

  2. I haven’t checked it in a while, but when I wrote the tutorial, my other editors could ONLY edit a single page that I had assigned them to. I’ll have to double check on it.

    Thanks for the heads-up that WP may have changed!

  3. This is awesome!

    I’ve been looking for a solution to this problem since WP’s built-in roles & capabilities is a bit lacking. This saved me several hours of research, works as advertised, and is much appreciated.

    Thank You! :)

  4. Thank you for the great tutorial! However, the link in step #2 is no longer working… I tried searching the content on the website instead, and still nothing. Please help! Thanks again!

  5. I found the original content of the page step#2 linked to with the WaybackMachine. here is the extract of the original post:

    Hey Ryan,

    You can try this. Since you said people are editing pages, I assume their role is set to “Editor” in WordPress. There is a way to not allow editors to edit other people’s pages. To do this without a plugin, open your theme’s functions.php. On the top line, directly underneath the opening remove_cap(‘edit_others_pages’);
    To not let them edit blog posts of other people, also paste this underneath:

    Code:
    $role->remove_cap(‘edit_others_posts’);
    Reload your websites page (an actual blog page, not the admin page), then delete those lines from that file as it’s already made the change to your database.

    Now Editors will be able to see other peoples pages but not edit them. Let me know if that helps.

    EDIT: Just a reminder, this makes editors able to only edit pages they’ve created. So it’s fairly limiting unless you have people sharing logins (aka, one login for the “Team” another login for the “Coaches”, etc). So this may not be exactly what you need. But I couldn’t tell just from reading.
    – John Kolbert

    hope this help

  6. looks like the most important part of my last comment was cut off, trying again:

    Edited extract from original page that step#2 linked to:

    Hey Ryan,

    You can try this. Since you said people are editing pages, I assume their role is set to “Editor” in WordPress. There is a way to not allow editors to edit other people’s pages. To do this without a plugin, open your theme’s functions.php. On the top line, directly underneath the opening php tag, paste the following:

    Code:
    $role = get_role(‘editor’);
    $role->remove_cap(‘edit_others_pages’);
    To not let them edit blog posts of other people, also paste this underneath:

    Code:
    $role->remove_cap(‘edit_others_posts’);
    Reload your websites page (an actual blog page, not the admin page), then delete those lines from that file as it’s already made the change to your database.

    Now Editors will be able to see other peoples pages but not edit them. Let me know if that helps.

    EDIT: Just a reminder, this makes editors able to only edit pages they’ve created. So it’s fairly limiting unless you have people sharing logins (aka, one login for the “Team” another login for the “Coaches”, etc). So this may not be exactly what you need. But I couldn’t tell just from reading.
    – John Kolbert

Leave a Reply

Your email address will not be published. Required fields are marked *