SharePoint Document Issues

Fix a SharePoint Code Snippet Web Part That Disappears

Ayan MasoodAyan Masood Nov 14, 2026 868 views

Question details

The user needs help with a SharePoint Code Snippet web part that disappears after saving code containing double brackets.

SharePoint Code Snippet Web Part Disappears After Saving Double Brackets
Product
SharePoint Online Code Snippet web part
Device & OS
not provided
Scenario
A user adds code containing double brackets, such as [[test]], to a Code Snippet web part on a modern SharePoint page.
Observed behavior
The web part may disappear after the page is saved and refreshed.
Before you start

Confirm that the page is a modern SharePoint page and note the exact code that triggers the behavior. Use a test page if available, and remove sensitive information from any example you plan to share with support.

Solution 1Recommended

Reproduce the SharePoint web part issue and contact Microsoft support

Use this approach when a Code Snippet web part disappears after saving code with double brackets.

1
Test the snippet

On a modern SharePoint test page, select Edit, add a Code Snippet web part, and enter a minimal example such as [[test]].

2
Save and refresh

Save or publish the page, then refresh it in your browser. Note whether the web part disappears and record the page URL and time of the test.

3
Open a support request

Ask a Microsoft 365 administrator to sign in to the Microsoft 365 admin center and open Help & support or Support to create a service request.

4
Provide the reproduction details

In the support request, include the test snippet, page URL, reproduction steps, and any relevant screenshots or error messages. Exclude sensitive code and data.

Reproduce the SharePoint web part issue and contact Microsoft support
Microsoft investigation may be needed: The issue has been reproduced on a modern SharePoint page. Reporting it gives Microsoft support the details needed to investigate the web part error.
Free Microsoft Office alternative

Work with Office documents in WPS Office

WPS Office is a free, lightweight alternative for working with Office documents in a familiar interface. Its format compatibility helps you move existing files between applications, although it does not fix SharePoint web part errors.

Document code snippets and troubleshooting notes in WPS WriterOpen and edit Microsoft Word DOCX filesUse a familiar interface for a smoother transition from Microsoft OfficeWork with a free, lightweight office suite
microsoft office alternative - wps office

Frequently Asked Questions

Why does the Code Snippet web part disappear after a refresh?

The behavior may occur when the snippet contains double brackets such as [[test]]. The exact cause requires investigation by Microsoft support.

How can I check whether double brackets trigger the issue?

On a modern SharePoint test page, add a Code Snippet web part containing [[test]], save or publish the page, and refresh it to check whether the web part remains visible.

Where do I report this SharePoint web part problem?

Ask a Microsoft 365 administrator to create a service request through Help & support or Support in the Microsoft 365 admin center. Include the reproduction steps and a sanitized example.

Can WPS Office repair the SharePoint Code Snippet web part?

No. The web part is a SharePoint feature, so Microsoft support should investigate the error. WPS Writer can be used separately to document the issue.