How to Fix SharePoint Template Links Redirecting to Original Page
Question details
The user is attempting to create a modern SharePoint page template with internal section links, but when a new page is generated, the internal links fail to update and continue pointing to the original template page.

- Product
- Microsoft SharePoint
- Device & OS
- not provided
- Scenario
- Creating a new modern SharePoint page from a custom template that includes internal navigation links, such as a table of contents linking to sections on the same page.
- Observed behavior
- The internal anchor links remain tied to the absolute URL of the original template page instead of dynamically updating to reference the newly created page.
Verify whether your SharePoint site is utilizing Modern pages or classic Wiki pages, as hyperlink behavior and available formatting options differ significantly between the two.
Update Internal Links Manually on the New Page
Because modern SharePoint page templates hardcode absolute URLs for heading anchors, you must manually edit the internal links every time you generate a new page from the template.
Modern SharePoint pages currently do not support dynamic relative URLs for internal anchor links within standard text web parts. When a template is saved, it preserves the exact web address of the original page.
Generate your new SharePoint page from the saved modern template by clicking 'New' and selecting your custom template.
Click the 'Edit' button located at the top right corner of the newly created SharePoint page.
Highlight the linked text in your table of contents or navigation section, click the edit link icon, and replace the old template URL with the current page's URL followed by the specific heading anchor.
Save your edits and republish the page to ensure all internal links navigate correctly within the current document.

Use a Classic SharePoint Wiki Page with HTML Anchors
If manually updating links on every new page is too inefficient, you can revert to using classic Wiki pages where HTML anchor IDs can be explicitly defined using relative paths.
Create and Manage Heavily Linked Document Templates with WPS Office
If managing internal links in SharePoint pages becomes too restrictive, consider creating comprehensive, highly structured documents with WPS Writer. It is lightweight, free, and perfectly handles bookmarks, tables of contents, and internal hyperlinks without breaking them when used as a template.
- 1. Download and Install WPS Office: Get WPS Office for free from the official website and launch WPS Writer.
- 2. Structure Your Document: Use the built-in Heading styles to organize your content clearly. This prepares the document for automated linking.
- 3. Insert a Dynamic Table of Contents: Navigate to the 'References' tab and insert a Table of Contents. WPS Writer will automatically generate internal links that remain fully functional even when the file is saved and reused as a template.

Frequently Asked Questions
Why do my SharePoint modern page anchor links include the full page URL?
Modern SharePoint automatically generates anchor links for headings using absolute URLs (the entire web address). When you save the page as a template, those specific web addresses are hardcoded into the links, causing new pages to point back to the original template.
Can I use relative URLs for internal links in modern SharePoint pages?
Currently, modern SharePoint pages do not natively support relative anchor links (such as just typing '#heading1') within standard text web parts. Users are required to input a valid, fully qualified URL.
Are there third-party web parts that resolve this SharePoint template link issue?
Yes, there are custom SPFx (SharePoint Framework) web parts available in the SharePoint store or through developer communities that offer dynamic table of contents generation. These automatically scan the current page for headings and generate relative links on the fly.
Where can I request Microsoft to change this template link behavior?
You can submit feedback and feature requests directly to Microsoft through the official SharePoint Feedback portal or engage with developers in the Microsoft Tech Community forums.




