Wordpress TinyMCE insert link modification to offer ‘open in new window’ as default

June 21, 2014 9:26 CEST, under technicalities category
last updated Jun 21st, 2014 11:35 CEST

Small but important modification .. every-time you write a post or a page and insert a link using the button in the TinyMCE in Wordpress a window pops-up with a dialog to enter a link.

Example in a picture:


The target is set by default to ‘open link in the same window‘. This is quite annoying as most people usually set links to open in a new window. There seems to be no configuration relating to this particular pop-up. The place where you can change the behavior of this pop-up is in a file in your WP installation path called:

/wp-includes/js/tinymce/themes/advanced/link.htm

The modification to achieve the ‘open in new window behavior’ is simple. Just change the line 55 of the file in question to look like this:

<option value=”_blank” selected >{$lang_insert_link_target_blank}</option>

And this is it … your pop-up should change and look like this:

Please note this post refers to the old version of WP (2.3) however the principle should be similar with other versions as well.


We value your interest and opinions ...
  1.  (required)
  2. please, share your email or web address to get in touch (not required) this form delivers the message to us, does not leave a comment below
  3. Captcha