Fix SharePoint Button Opens a Link Instead of Scrolling to Section
Question details
The user needs to configure a SharePoint button to scroll to a specific heading or section on the same page rather than opening a new tab or redirecting.

- Product
- SharePoint
- Device & OS
- not provided
- Scenario
- Linking a button web part to a page section using a heading permalink.
- Observed behavior
- The button opens a new tab and redirects to a full external URL, often containing the mcas.ms domain, instead of scrolling to the target section.
Ensure you have edit permissions for the SharePoint page and verify that the section you want to link to is formatted using a standard SharePoint Heading style.
Verify Heading Styles and Recreate the Relative Permalink
Ensure the target text acts as an anchor by using a heading style, and update the button with the correct relative permalink.
SharePoint automatically generates a permalink for any text formatted as a heading. If a button points to a full absolute URL instead of a relative permalink, it may force the page to reload or open a new tab.
Navigate to your SharePoint page and click the 'Edit' button located at the top right corner of the screen.
Highlight the text at your target destination and use the text formatting toolbar to apply a Heading 1, Heading 2, or Heading 3 style.
Hover your cursor over the newly formatted heading until a link icon appears. Right-click the icon and select 'Copy link address'.
Select your button web part and click the pencil icon to open its properties. Paste the copied link into the link field, ensuring it acts as a relative link (e.g., starting with a # symbol for the heading).
Republish the page and click the button to verify it smoothly scrolls to the section without opening a new tab.

Remove MCAS.MS Redirects and Check Tab Settings
Fix issues where links are rewritten by Microsoft Defender for Cloud Apps and prevent the button from opening in a new tab.
Looking for a Seamless Document Collaboration Tool?
While SharePoint handles intranet pages, managing and co-authoring the actual documents can sometimes be complex. WPS Office provides a free, lightweight, and highly compatible alternative to Microsoft Office. Enjoy a familiar interface and seamless document sharing without the hassle of complicated link configurations.

Frequently Asked Questions
Why does my SharePoint link change to an mcas.ms URL?
The mcas.ms domain is used by Microsoft Defender for Cloud Apps. It intercepts and rewrites URLs for security monitoring, which can inadvertently break relative anchor links on SharePoint pages, causing them to act as external redirects.
How do I create a permalink for a section in SharePoint?
Highlight the text you want to link to, apply a Heading style (Heading 1, 2, or 3) from the text web part toolbar, hover over the text to reveal the link icon, and copy the link address.
Can I stop a SharePoint button from opening a new tab?
Yes. Edit the button web part properties and look for the 'Open in a new tab' toggle. Turn this off so the link opens in the current window. Note that absolute external links may sometimes still default to a new tab depending on site settings.
Why is my heading permalink not working after publishing the page?
This often happens if the page is heavily cached by your browser or if the link was pasted as an absolute URL instead of a relative URL. Try pasting only the anchor part (e.g., #your-heading) and test the page in an incognito or private browsing window.




