如何在WordPress后台创建仅可修改内容的受限Editor account?
Absolutely! You can totally set up a restricted Editor account for your clients in WordPress—here's a straightforward, step-by-step guide to make sure they only get access to content editing, with no extra administrative fluff:
Step 1: Create the Base Editor Account
First, set up the account with the default Editor role, then we'll trim down its permissions:
- Head to your WordPress admin dashboard and go to Users > Add New
- Fill in your client's basic details (username, email, display name)
- Under Role, select Editor (this gives them core content editing access by default)
- Send them an account invite or set a temporary password, then share it securely
Step 2: Restrict Unnecessary Features
You have two solid options here—pick the one that matches your comfort with code:
Option 1: Custom Code (No Plugins Needed)
Add this snippet to your theme's functions.php file (or better yet, a custom plugin to avoid losing changes when updating your theme):
// Hide unwanted admin menu items for Editors function remove_editor_unwanted_menus() { // Only apply to Editors who aren't admins if (current_user_can('editor') && !current_user_can('administrator')) { // Remove menus you don't want accessible remove_menu_page('index.php'); // Dashboard remove_menu_page('upload.php'); // Media Library (if you want to control media uploads) remove_menu_page('themes.php'); // Appearance remove_menu_page('plugins.php'); // Plugins remove_menu_page('users.php'); // User Management remove_menu_page('tools.php'); // Tools remove_menu_page('options-general.php'); // Settings // Uncomment the line below if you want to block page edits // remove_menu_page('edit.php?post_type=page'); } } add_action('admin_menu', 'remove_editor_unwanted_menus'); // Trim down Editor capabilities to only content editing function restrict_editor_capabilities() { $editor_role = get_role('editor'); // Remove capabilities that aren't needed for content edits $editor_role->remove_cap('manage_categories'); $editor_role->remove_cap('manage_links'); $editor_role->remove_cap('moderate_comments'); // Uncomment these if you want to block page editing // $editor_role->remove_cap('edit_others_pages'); // $editor_role->remove_cap('publish_pages'); } add_action('init', 'restrict_editor_capabilities');
Pro tip: Adjust the lines to match your needs—for example, if you want clients to edit pages too, skip removing the Pages menu and page-related capabilities.
Option 2: Use a Role Management Plugin (For Non-Coders)
If code feels intimidating, use a free plugin like User Role Editor (search for it directly in your WordPress plugin directory):
- Install and activate the plugin
- Go to Users > User Role Editor in your dashboard
- Select the Editor role from the top dropdown
- Uncheck all the capabilities you don't want your client to have (e.g., managing plugins, editing themes, moderating comments)
- Use the plugin's menu restriction tools to hide any admin menu items you want to lock down
- Save your changes to apply the restrictions
Step 3: Test the Account
Always log in with the client's Editor account to verify everything works as expected:
- Make sure they can only access the post (and/or page) editing screens
- Double-check that restricted menus and capabilities are completely hidden/unavailable
内容的提问来源于stack exchange,提问作者arun boyo

