How to Prevent Users From Editing SharePoint Pages (Guide)

How to Prevent Users From Editing SharePoint Pages (Guide)

Last Updated on December 14, 2023

Need to prevent users from editing pages?

In this guide, you will learn three methods that will allow you to stop users from editing all or certain pages in a SharePoint site.

Let’s get started.

Method 1: For All Pages

Normally, members of the site can edit pages.

Unfortunately, this can cause problems with the site pages especially if the members aren’t well-trained.

The good news here is that the process is straightforward and easy to understand.

Step #1: Go to the site pages library settings

From the home page, click the site contents from the quick toolbar.

If it’s not there:

  • Click the site’s gear icon
  • Select site contents
click site contents from the settings gear

From here:

  • Right-click on site pages
  • Select settings
Go to the settings of the library

Note: You can also get to the settings page from the site pages library through the gear icon > library settings > more library settings.

Step #2: Break permission inheritance

For you to set unique permissions, you need the pages to stop inheriting permissions.

If you’re doing this for all the pages, then it’s better to do this all at once by doing it on the document library level.

On the settings page, click the permissions for this document library link:

you can find it under the permissions and management group

The next page will show you all the people and groups who have access to the site.

What you need to do here is to click the stop inheriting permissions button from the toolbar:

stop the library from inheriting parent permissions

Step #3: Edit user permissions

The site pages library inherits permissions by default.

With that, the site members group has edit user permissions, which is why they can edit any pages on the site.

To stop that:

  • Select the members group from the list (site name + “members”)
  • Click the edit user permissions button from the toolbar
edit the user permissions of the members group

On the next page:

  • Uncheck the box for edit permissions
  • Check the box for read permissions
  • Click the ok button to save the changes
change the permission level to read access

With this, all site members and visitors will only be able to read/view the site — they won’t be able to make any changes.

Sign up for exclusive updates, tips, and strategies

    Method 2: For Specific Pages

    But what if you need to prevent users from editing specific pages only?

    Well, it’s even easier seeing that you don’t even need to get into the backend of the page or library.

    Access the site pages library and do the following:

    • Select the target page
    • Open the details pane
    • Click the manage access link
    manage the access level of that page

    Note: Unfortunately, you can’t do this in bulk. So you have to edit each page access individually.

    This will open a window that contains all the groups and people who have direct access to the page.

    Here’s what to do next:

    • Find the members group (site name + “members”)
    • Click the toggle button
    • Change it to can view option
    change the members group access to can view

    With this, all site members can only view the page — they won’t be able to make changes.

    Method 3: Using PowerShell

    For users who want to use code to do the changes right away without any additional clicks, you can also use PowerShell.

    The code snippet below (credits here) will be able to automatically prevent users from editing pages in your SharePoint site.

    Use the following code snippet:

    #Parameters
    $SiteURL = "https://tenant.sharepoint.com/sites/sitename"
    $ListName = "Site Pages"
     
    Try {
        #Connect to PnP Online
        Connect-PnPOnline -Url $SiteURL -Interactive
     
        #Get the Default Members Group 
        $MembersGroup = Get-PnPGroup -AssociatedMemberGroup
     
        #Break Permission Inheritance of the List
        Set-PnPList -Identity $ListName -BreakRoleInheritance -CopyRoleAssignments
     
        #Remove "Edit" permission from the list
        Set-PnPGroupPermissions -Identity $MembersGroup -List $ListName -RemoveRole "Edit"
     
        #Grant "Read" permission to the Group
        Set-PnPListPermission -Identity $ListName -AddRole "Read" -Group $MembersGroup
     
        Write-Host "Removed 'Edit' Permissions and Granted 'Read' on 'Site Pages' to $($MembersGroup.Title). " -foregroundcolor Green
    }
    Catch {
        write-host -f Red "Error Setting Permissions!" $_.Exception.Message
    }

    Restoring the Permission Levels

    There might be some changes that require you to undo the changes:

    • Enabling users to edit all pages
    • Enabling users to edit certain pages

    Here’s how you can reverse the actions in the previous sections:

    Restoring permissions inheritance

    To enable users to edit all pages again in a less hassle way, you can restore the permission inheritance of the site pages library.

    For that, you need to visit the permissions pages again:

    • Go to the library’s settings page
    • Then to the permissions for this document library

    What you need to do now is click the delete unique permissions button from the toolbar:

    restore the permission inheritance of the site pages library

    Related: How to Create a SharePoint Custom Permission Level (Guide)

    Give edit access to site members

    If you have changed the access level for an individual page, you can also reverse it the same way.

    Bring out the manage access window:

    • Select the page
    • Open the details pane
    • Click the manage access link

    From here, find the group/user (using the previous example, let’s use the site members group):

    • Click the toggle button
    • Select the can edit option
    enable site members to edit the page

    Understanding SharePoint Permissions

    In case you got confused with permission levels, I will reiterate them here.

    After all, understanding permissions is crucial for maintaining the security and integrity of your SharePoint sites.

    Types of Permissions

    When it comes to SharePoint permissions, think of them as keys that open different doors.

    Some keys open basic doors, while others open doors to entire floors.

    Let’s break down the three main types of permissions you will often encounter:

    Read

    • What it does: Allows users to view pages, list items, and documents
    • What it doesn’t do: Prevents users from editing, deleting, or adding anything on the site

    Think of the ‘Read’ permission as giving someone a visitor’s pass to your office building.

    They can walk around and see what’s there, but they can’t rearrange the furniture.

    This is ideal for users who need access to information but should not be making changes.

    Edit

    • What it does: Enables users to add, edit, and delete pages, lists, and document libraries
    • What it doesn’t do: Users can’t change the site settings or create new sites under the current site

    If ‘Read’ is a visitor’s pass, then ‘Edit’ is like giving someone their own office within the building.

    They can decorate it, and move furniture around, but they can’t affect other offices or make structural changes to the building.

    The ‘Edit’ permission is perfect for team members who need to contribute to projects but shouldn’t have the keys to the entire building.

    Full Control

    • What it does: Grants users the ability to do everything, including changing site settings and permissions
    • What it doesn’t do: Well, it pretty much allows everything

    With ‘Full Control’, you’re essentially handing over the master key.

    The user can open every door, change the locks, and even hand out new keys.

    This level of access is generally reserved for administrators and should be given out sparingly.

    Permission Levels

    Now that you understand the basic types of permissions, let’s talk about permission levels.

    SharePoint comes with predefined permission levels that bundle various permissions together.

    These include:

    • Read: Includes ‘View Items’, ‘Open Items’, and other read-related permissions
    • Contribute: Includes ‘Add Items’, ‘Edit Items’, ‘Delete Items’, and more
    • Edit: A step above ‘Contribute’, includes managing lists and document libraries
    • Design: Allows users to view, add, update, delete, approve, and customize
    • Full Control: Grants all available permissions

    Each permission level is like a pre-made recipe of individual permissions (Read, Edit, Full Control, etc.).

    You can also create custom permission levels to suit the specific needs of your organization.

    Related: SharePoint Permissions Explained: How Permission Levels Work

    Do you have more questions about preventing users from editing pages? If yes, ask away in the comment section.

    For business-related questions and messages, you can reach me on this page. I’ll get back to you asap.

    About Ryan Clark

    As the Modern Workplace Architect at Mr. SharePoint, I help companies of all sizes better leverage Modern Workplace and Digital Process Automation investments. I am also a Microsoft Most Valuable Professional (MVP) for SharePoint and Microsoft 365.

    Subscribe
    Notify of
    guest
    0 Comments
    Oldest
    Newest Most Voted
    Inline Feedbacks
    View all comments
    0
    Would love your thoughts, please comment.x
    ()
    x
    Scroll to Top