How to make all links open in new tab?

Prev Next

Plans supporting the use of custom CSS and JS in knowledge base site

Professional
Business
Enterprise






When you insert a hyperlink in the article, an option is available to open the hyperlink 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. Follow the workaround below to open all the hyperlinks in a new tab.

Solution

  1. Navigate to Settings () > Knowledge base site > Customize site > Custom CSS & JavaScript in the Knowledge base portal.

  2. From the left navigation pane, click on the JavaScript tab and paste the following JavaScript snippet:

jQuery(".content_block_text a").attr("target", "_blank");
$(document).on("click", ".block-article a", function() { $(this).attr("target", "_blank"); });
  1. Click Save.

NOTE

All hyperlinks in your article will open in a new tab now.