SharePoint Document Issues

Restore Editing on a SharePoint 2016 Page After Adding Web Part Code

Emma BrownEmma Brown Nov 20, 2026 868 views

Question details

Restore editing controls on a SharePoint 2016 page after custom code was added to a Web Part.

Restore Editing on a SharePoint 2016 Page After Adding Web Part Code
Product
SharePoint Server 2016
Device & OS
not provided
Scenario
A user needs to modify a SharePoint page after adding code to a Media and Content or Script Editor Web Part.
Observed behavior
The page's editing controls disappeared, preventing normal editing.
Before you start

Identify the affected page URL and the Web Part that contains the recently added code. Sign in with an account that can edit the page, or ask a SharePoint administrator for help.

Solution 1Recommended

Remove the Problem Web Part Using the Maintenance Page

Try the Web Part maintenance page when custom code prevents the normal page controls from appearing.

1
Open the maintenance page

In the browser address bar, append ?contents=1 to the affected page URL and press Enter. If the URL already has a query string, append &contents=1 instead.

2
Select the Web Part

On the Web Part Maintenance page, select the checkbox beside the Media and Content or Script Editor Web Part that contains the recently added code.

3
Remove and test

Click Delete and confirm the removal. Return to the original page URL without the contents parameter and check whether the Edit controls appear.

Remove the Problem Web Part Using the Maintenance Page
Deleting removes the Web Part: Deleting the Web Part also removes its configuration and any code stored in it. If you are unsure which Web Part to select or cannot access the maintenance page, contact your SharePoint administrator.
Free Microsoft Office alternative

Work with Office Documents in WPS Office

WPS Office is a free, lightweight alternative for working with documents, spreadsheets and presentations. Its familiar interface and Microsoft Office format compatibility make it easy to move existing files. It does not repair SharePoint page editing or Web Parts.

Edit documents that you use alongside SharePoint pagesOpen and save common Microsoft Office formats, including DOCX, XLSX and PPTXUse familiar document, spreadsheet and presentation toolsMove existing Office files into a lightweight, easy-to-use workspace
microsoft office alternative - wps office

Frequently Asked Questions

How do I open the Web Part maintenance page?

Append ?contents=1 to the affected page URL in your browser. If the URL already contains a query string, append &contents=1 instead.

Will deleting the Web Part remove its code?

Yes. Deleting the Web Part removes its configuration and any code stored in it. Select only the Web Part you intend to remove, and ask an administrator if you are unsure.

What if I cannot access the maintenance page?

Contact your SharePoint administrator and provide the page URL, the Web Part type and the code that was added. You can also ask the SharePoint Server community on Microsoft Q&A.

Can WPS Office restore SharePoint page editing?

No. WPS Office can work with Office documents, but it cannot remove a SharePoint Web Part or restore the page's editing controls.