Drupal - How to set target="_blank" for links in CKEditor

D8 Editor Advanced link module

Enhances the link Dialog in D8 CKEditor. Allows to define the following attributes:

  • title
  • class
  • id target
  • rel

enter image description here


You can use the Linkit module and add a "target" attribute at admin/config/content/linkit/manage/default/attributes/add

It has two options:

  • Selectlist with predefined targets.

Dialog with options

  • Simple checkbox to allow links to be opened in a new browser window or tab.

Dialog with checkbox


If you want every link to open in a new window, it'd be better to not use the Editor Advanced Link module, but instead add a filter to your text format that sets target=_blank on every <a>.