logo
search
SharePoint Document Issues

How to Edit SharePoint Pages as HTML: Classic vs Modern Sites

Aamir Naveed AkramAamir Naveed Akram Sep 27, 2026 869 views

Question details

The user wants to know if they can edit SharePoint web pages directly using HTML and needs clarification on the differences between Classic and Modern SharePoint sites.

Can SharePoint Pages Be Edited Directly as HTML?
Product
SharePoint
Device & OS
not provided
Scenario
Customizing web pages by embedding HTML or scripts to extend site functionality.
Observed behavior
Seeking a way to inject HTML or scripts, but encountering restrictions or missing web parts depending on the SharePoint page version.
Before you start

Check whether your SharePoint site uses a Classic or Modern page layout, as Microsoft restricts direct HTML and script injection in Modern environments for security purposes.

Solution 1

Use Editor Web Parts in Classic SharePoint Pages

If you are using a Classic SharePoint site, you can directly insert HTML and custom scripts using legacy web parts.

Classic SharePoint pages support the Content Editor and Script Editor web parts. These allow administrators and contributors to write or paste raw HTML, CSS, and JavaScript directly onto the page.

1
Edit the page

Navigate to your Classic SharePoint page, click the 'Gear' icon or 'Page' tab, and select 'Edit Page'.

2
Add a web part

Click 'Add a Web Part' in the zone where you want the custom HTML to appear.

3
Insert Content or Script Editor

Under the 'Media and Content' category, select 'Content Editor' or 'Script Editor' and click 'Add'. You can now click inside the web part to edit the source code and insert your HTML.

Site Settings Requirement: These web parts will only be available if custom script capabilities have not been disabled by your SharePoint administrator at the tenant level.
Free Microsoft Office alternative

Manage Your Documents Seamlessly with WPS Office

While SharePoint handles your team's intranet and web page hosting, you still need a reliable suite for your actual documents. WPS Office is a lightweight, fully compatible, and free alternative to Microsoft Office that allows you to create, edit, and share documents with ease.

  1. 1. Download the software: Visit the official WPS Office website and download the free installation package for your operating system.
  2. 2. Open your Office files: Launch WPS Office and open your existing Word, Excel, or PowerPoint files without worrying about formatting issues.
  3. 3. Edit and collaborate: Use the familiar interface to edit your documents and save them in standard Office formats to share with your SharePoint team.
Completely free and highly lightweight on system resourcesPerfect compatibility with Microsoft Office formats like .docx, .xlsx, and .pptxFamiliar user interface requiring zero learning curveBuilt-in PDF editing tools for streamlined document workflows
microsoft office alternative - wps office

Frequently Asked Questions

Why is the Script Editor missing in Modern SharePoint?

Microsoft removed the Script Editor in Modern SharePoint pages to prevent cross-site scripting (XSS) attacks, ensure pages remain mobile-responsive, and maintain overall platform stability.

Is it safe to upload custom ASPX pages to SharePoint?

Generally, it is not recommended. Uploading raw ASPX files or enabling unverified custom scripts creates severe security vulnerabilities and complicates future platform updates.

What is the SharePoint Framework (SPFx)?

SPFx is a page and web part model that provides full support for client-side SharePoint development. It is Microsoft's officially recommended method for developers to safely integrate custom HTML, CSS, and JavaScript into Modern SharePoint pages.

How do I embed a YouTube video on a SharePoint page?

In Modern SharePoint pages, you can add the built-in 'YouTube' web part or use the 'Embed' web part by pasting the video's iframe HTML code directly into the property pane.