Skip to content

Ability to remove the site editor and template editing from WordPress admin areas for certain user roles #49326

@phil-sola

Description

@phil-sola

What problem does this address?

There is always a lot of discussion and concerns with FSE, especially from agencies and developers about content lockdown and removing the ability for clients to break layouts and pages while editing content.

With FSE, the new site editor is almost like a modern day version of the theme file editor that can be turned off by developers to hide this feature under ‘Appearance’ using a constant.

Previously users have been able to edit all theme files and templates using code if DISALLOW_FILE_EDIT wasn’t set to true.

I think now all these templates are editable using the site editor it would be great to have similar functionality where developers could define a constant and turn off the site editor for specific user roles.

This way developers and agencies could lock down that part of the admin area as they have done historically, while still allowing users to edit posts and pages for content as always.

I have searched through open and closed issues but couldn’t find anything relating to this currently.

What is your proposed solution?

I don’t know how the site editor is enabled and what happens under the hood technically when a FSE theme is active but I would love to see something simple like defining a constant to be able to DISALLOW_SITE_EDITOR which would do a couple of things:

  1. Remove the site editor from the appearance menu in the admin dashboard.
  2. Remove any links to the site editor from single posts and pages to edit the current template.

This constant could be defined within some sort of conditional check for certain user roles.

This would be a great way to opt-in to locking down the site even further than individual block locking and being opt-in would not affect anyone who didn’t want this feature.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions