SharePoint Document Issues

How to Edit HTML Source on a Modern SharePoint Page

Jason MillerJason Miller Nov 22, 2026 868 views

Question details

The user wants to edit the HTML source code of a modern SharePoint page.

How to Edit HTML Source on a Modern SharePoint Page
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
Customizing the content or layout of a modern SharePoint site page.
Observed behavior
Modern pages use predefined components and do not provide a built-in HTML source editor.
Before you start

Confirm that the page is a modern SharePoint page and that you have permission to edit it. Identify whether you need to change page content or add custom functionality, since the supported approach differs.

Solution 1Recommended

Customize the page with modern SharePoint web parts

Use built-in web parts to change content and layout without editing the page's HTML source.

1
Open the page editor

Open the modern SharePoint page and select Edit at the top of the page.

2
Add or modify a web part

Select an existing web part to edit it, or select the plus button in a section to add a web part such as Text, Image, or Embed.

3
Publish the changes

Select Publish or Republish when you are ready to make the changes visible.

HTML source editing is not available: Modern pages do not offer a built-in editor for the page's raw HTML. The Embed web part is subject to SharePoint's embedding and site policies and is not a general HTML source editor.
Free Microsoft Office alternative

Create and Edit Office Documents with WPS Office

WPS Office is a free, lightweight alternative for editing documents, spreadsheets, and presentations in a familiar interface. Its Microsoft Office format support makes it easy to move existing files into WPS. It does not edit the HTML source of a modern SharePoint page.

Edit documents that support your SharePoint content workflowOpen and save common Microsoft Office formats, including DOCX, XLSX, and PPTXUse a familiar interface for everyday document editingWork with a free, lightweight Office alternative
microsoft office alternative - wps office

Frequently Asked Questions

Can I open the HTML source of a modern SharePoint page?

No. Modern SharePoint pages do not provide a built-in option to edit their raw HTML source. Select Edit on the page to work with its supported sections and web parts.

Can I add custom functionality to a modern page?

Yes. A developer can create a custom SharePoint Framework web part, and an administrator can deploy it through an app catalog. Once available, add it from the plus button while editing the page.

Can I paste arbitrary HTML into the Embed web part?

The Embed web part is intended for supported embedded content, not unrestricted HTML editing. What you can embed depends on SharePoint's embedding rules and your organization's policies.

Would a classic SharePoint page give me more editing options?

Classic pages can offer different customization options, depending on the site configuration and permissions. Check with your SharePoint administrator whether a classic page is available and suitable; switching experiences does not directly turn a modern page into an editable HTML page.