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.
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
- In the Knowledge Base portal, go to Settings > Knowledge base site > Custom CSS & JavaScript.

- Select the JavaScript tab and paste the snippet for your Knowledge Base site version from the quick reference above.
- Click Save.

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.