How to Make Your WordPress Links Open In A New Window

In: Daily

30 Jan 2009

If you want your links in WordPress to open in a new window/tab:

  1. Navigate to your WordPress Blog Entry or Page
  2. Click on the existing link or highlight the words you want to be linked
  3. Click on the Link Icon
  4. Change the Target option to: Open Link in a new window
  5. Click Update and then Update or Publish your blog entry/page.

How to make your WordPress links open in a new window.

To manually add the code to your HTML, use the target attribute with the value of _blank like this: <a href=”http://yourlink.com” target=”_blank“>Your Link</a>
Read more about the target attribute at W3Schools.com

Share

11 Responses to How to Make Your WordPress Links Open In A New Window

Avatar

Carla

April 6th, 2009 at 2:34 am

This information was just what I needed. Thank you.

Avatar

How

August 11th, 2009 at 9:20 pm

how to make it default to all of your pages

Avatar

Mike

April 14th, 2010 at 3:22 pm

I would like to know that too.
Its Extremely annoying to do this in every single post. It kills so much time. Any ideas?

Please someone….

Avatar

Cliff

June 1st, 2010 at 9:41 am

Me too…how to make it the default selection???

Avatar

Dave

June 24th, 2010 at 1:25 pm

1. Open this file:

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

2. Look for this code around line 140

lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang(‘not_set’), ”);
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang(‘advanced_dlg.link_target_same’), ‘_self’);
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang(‘advanced_dlg.link_target_blank’), ‘_blank’);

3. Reorder so target_blank option is on top

lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang(‘advanced_dlg.link_target_blank’), ‘_blank’);
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang(‘advanced_dlg.link_target_same’), ‘_self’);
lst.options[lst.options.length] = new Option(tinyMCEPopup.getLang(‘not_set’), ”);

Avatar

Christian

September 29th, 2010 at 4:00 pm

Create a JS file with this as content:

$(document).ready(function () {
$(“.single_content A”).attr(‘target’, ‘_blank’);
$(“.excerpt A”).attr(‘target’, ‘_blank’);
});

Then add this to the header file at the end of the script tags AFTER the jQuery include.

<script type="text/javascript" src="/lib/js/links.js”>

Avatar

Roezer

October 23rd, 2010 at 2:03 pm

Dave’s Method worked but5 I would Really Like to Know how to Make All Dashboard Links open in a New Window. Mainly when I am trying to Understand a New WordPress Plugin for Example I would Like to Be able to Read the Instructions in One Tab and Input the Settings in another. Daves Method is Great for Editing Content I have not Tried Christians.

Avatar

Paddle Guy Jason

January 6th, 2011 at 1:11 am

thanks for the tip, just what i needed fast simple advise.

Avatar

James

March 24th, 2011 at 5:30 am

Thanks but I wish there was a way to specify to wordpress that all outbound links should open in a new tab

Avatar

Dave

March 24th, 2011 at 6:59 am

Avatar

Sustainability WA

April 6th, 2011 at 7:40 pm

Thankyou,

Just what I needed. So simple if you know where to look.

Comment Form

Follow Me

    Related Links

    RSS See My Latest Photography