I would like to have a custom user role that can edit the Menu items under the Appearance tab. But I don't want my custom role to have the ability to edit every menu on my WordPress site. I only want this role to be able to edit a single menu. For example, in the screenshot below I want my user role to only be able to see and edit Menu A. enter image description here I don't want my role to see and edit the Header, Footer, or any other menus. I have searched other Stackoverflow questions like the one in this link: allow editors to edit menus?

But that solution allows the role to access every menu on my Wordpress site. In fact, that solution allows the role to access other Appearance functionalities like the ability to customize the theme itself, which I don't want.

I would prefer to solve this problem by writing my own PHP code instead of using an external plugin, although any help would be much appreciated.

  • 1
    WordPress capabilities aren't this fine-grained. What does this menu represent, and why can this role edit it? Maybe the are different approaches to the underlying problem that work better than using menus. – Jacob Peattie May 1 '19 at 8:22
  • 1
    If the goal is granular permissions MultiSite may be your answer. You can set it up either as subdomain as subfolder (I'd suggest subfolder, easier to set up) and then assign each user to one particular subsite. From there, they can only edit Pages and Menus within that site. You also won't have to make CPTs in this setup. As mentioned above WP doesn't have a way to limit access to specific menus, and there aren't any plugins that add that functionality, particularly since there are currently 2 places to manage menus and who knows what will change when they are managed as Blocks. – WebElaine May 1 '19 at 13:13
  • @WebElaine If I build a multisite, can I still make the site appear as a single monolithic site to the end user? I still want every department page to see the same header menu. The only control that I want to give to each department is the sidebar menus. I'm using a Genesis theme, so I am guessing that I could write a plugin that shows the same header and footer for multiple sites – thomas93 May 1 '19 at 15:44
  • @JacobPeattie The menu represents a department within an organization. Each department would want the ability to edit their own menus and pages. For pages, I am going to utilize custom post types to support custom department pages as oppose to using the default pages in Wordpress. I would like to do the same for Menu items by leveraging the built in Wordpress Menu editor. Shouldn't there be a way to filter the list of Menus that certain roles can see? I heard Wordpress supports multisites, but I am building a monolithic site. Although I think multisites could help separate the Menu editors. – thomas93 May 1 '19 at 15:45
  • Yes, if you use the subfolder approach, the MultiSite can look like a single site to end users. You basically set up one theme that applies to all the sites, you can either use WP's menus or even just hard-code the links in the theme's header so the top navigation stays the same across all sites, and it really doesn't matter how big the site is - you just add a subfolder "subsite" for each area where you need to isolate permissions. I'm sure others would like the ability to restrict menu editing more granularly, but that functionality just hasn't been built. – WebElaine May 1 '19 at 18:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.