Restore Editing on a SharePoint 2016 Page After Adding Web Part Code
Question details
Restore editing controls on a SharePoint 2016 page after custom code was added to a Web Part.

- 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.
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.
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.
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.
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.
Click Delete and confirm the removal. Return to the original page URL without the contents parameter and check whether the Edit controls appear.

Ask a SharePoint Administrator or Community for Help
Use this option if the maintenance page is unavailable or you cannot identify or remove the Web Part.
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.

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.




