--- title: "How to make all links open in new tab" slug: "how-to-make-all-links-open-in-new-tab" description: "When you insert a hyperlink in the article, an option is available to make the hyperlink open in a new tab. There is no option in the Knowledge base portal to open all hyperlinks in knowledge base articles in a new tab." tags: ["Customization"] updated: 2026-06-20T09:33:06Z published: 2026-06-20T09:33:06Z canonical: "docs.document360.com/how-to-make-all-links-open-in-new-tab" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.document360.com/llms.txt > Use this file to discover all available pages before exploring further. # How to make all links open in new tab When inserting a hyperlink in an article, the Knowledge Base portal provides a per-link option to open it in a new tab. However, there is no built-in setting to make all hyperlinks open in a new tab by default. The workaround is to add a JavaScript snippet via Custom CSS & JavaScript settings, which applies the `target="_blank"` attribute to all article links automatically. --- ## When to use this workaround - **External links throughout your knowledge base**: if most of your hyperlinks point to external sites or resources, opening them in a new tab keeps readers on your knowledge base while they explore references. - **Large knowledge bases with consistent linking behavior**: when you want a uniform experience across all articles without manually setting each link's target. WARNING This JavaScript snippet applies `target="_blank"` to **all** hyperlinks in your articles, including internal links to other articles within the same knowledge base. Opening internal links in new tabs is generally not recommended, as it breaks the reader's navigation flow and the browser's back button behavior. If you only want external links to open in a new tab, apply `target="_blank"` to those links individually using the per-link option in the portal instead. --- ## Quick reference Use the snippet for your Knowledge base site version. ``` $(document).on("click", ".block-article a", function() { $(this).attr("target", "_blank"); }); ``` --- ## How to open all hyperlinks in a new tab 1. In the Knowledge Base portal, go to **Settings** > **Knowledge base site** > **Custom CSS & JavaScript**. ![Knowledge base site settings page showing the Custom CSS and JavaScript option in the left navigation.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/Custom%20css%20&%20js.png) 1. Select the **JavaScript** tab and paste the snippet for your Knowledge Base site version from the quick reference above. 2. Click **Save**. ![Custom JavaScript editor showing the open in new tab snippet pasted in the JavaScript tab with the Save button visible.](https://cdn.document360.io/860f9f88-412e-4570-8222-d5bf2f4b7dd1/Images/Documentation/image-1766930298587.png) After saving, all hyperlinks in your knowledge base articles will open in a new browser tab. --- ## Scope and coverage | Item | Detail | | --- | --- | | Scope | Global, all hyperlinks in all articles are affected | | Affected links | All `<a>` tags inside article content, including internal links | | Per-link alternative | Use the **Open in new tab** option when inserting individual links in the portal | | Reversible | Yes, delete the snippet from the JavaScript tab and save to revert | --- ## Best practices - **Use the per-link option for selective control**: if only certain links (such as external references or downloads) should open in a new tab, apply `target="_blank"` to those links individually rather than using this global workaround. - **Inform readers when links open in new tabs**: users expect the back button to return them to the previous page. Opening all links in new tabs silently removes that expectation. Consider adding a brief note in your knowledge base style guide or article templates to flag external links. - **Test after applying**: visit a few articles on the Knowledge Base site after saving the snippet to confirm all links behave as expected, including both internal cross-article links and external URLs. - **Remove the snippet if you switch to a selective approach**: once you start applying `target="_blank"` individually, remove the global JavaScript snippet to avoid conflicts and double-opening behavior.