SharePoint Document Issues

Fix SharePoint Scriptable Web Part Errors on Modern Pages

Amos GikundaAmos Gikunda Nov 22, 2026 868 views

Question details

The user needs a supported way to customize a SharePoint page when script and style tags cannot be used to hide column headers.

Fix SharePoint Scriptable Web Part Errors on Modern Pages
Product
Microsoft SharePoint
Device & OS
not provided
Scenario
The user wants to customize the appearance of columns on a modern SharePoint page, potentially using custom code or an iframe.
Observed behavior
Modern pages strip or do not support script and style tags in this context, and enabling custom scripting does not make those tags work on the page.
Before you start

Confirm whether you are editing a modern SharePoint page or a classic site page, and identify the list or content whose appearance you want to change. If you plan to embed a page, have its browser-accessible URL ready and check your organization's embedding restrictions.

Solution 1Recommended

Use a supported list view and web part on a modern page

Use this approach to control which list columns appear without inserting script or style tags.

A list view can hide individual columns, but it does not necessarily hide the remaining column headers. Custom script and style tags are not a supported way to hide those headers on a modern page.

1
Configure the list view

Open the SharePoint list, select the view menu, and choose Edit current view. Clear the columns you do not want to display, then save the view.

2
Edit the modern page

Open the page and select Edit. Add a List web part using the plus button, or select an existing List web part.

3
Select the view

Open the List web part's edit panel, choose the list and the configured view, then select Republish or Publish.

Use a supported list view and web part on a modern page
Free Microsoft Office alternative

Work with Office documents using 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 into your workflow. It does not fix SharePoint page scripting restrictions.

Edit document content in a familiar Office-style interfaceOpen and edit common Microsoft Office formats, including DOCX, XLSX, and PPTXUse a lightweight suite for documents, spreadsheets, and presentationsPrepare files for sharing in SharePoint without relying on page script tags
microsoft office alternative - wps office

Frequently Asked Questions

Why does enabling custom scripting not fix my modern SharePoint page?

Modern pages do not support inserted script and style tags in the same way as classic pages. Use supported web parts or consider an approved classic page if custom code is essential.

Can I hide list columns without using CSS?

Yes. Open the list's view menu, select Edit current view, and clear the columns you do not want to show. This hides those columns rather than just their headers.

What does an iframe need to work in SharePoint?

An iframe needs a src attribute pointing to a browser-renderable page. The source site must allow embedding, and the domain must satisfy SharePoint's embedding restrictions.

Can I add JavaScript to a modern page with the Embed web part?

The Embed web part is for supported embedded content, not for running arbitrary JavaScript or CSS on the modern page. Use a supported SharePoint component or consult your administrator about approved customization options.