In very old version of WordPress, you couldn’t add the ability to allow a link to open in a new window. However, that is no longer the case. You can add that whether you’re using the visual editor or the text editor, when you make a link open in a new window.
Here’s how to do that.
How To Make A Link Open In A New Window in WordPress
The easy way
To make a link open in a new window, you simply click on the link icon in your post or page content editor. When you do so in visual editor, you can highlight a word and click the link icon in the toolbar above the content editor. A little bar will show up like below.
Add your link in and then to make that link open in the new window, there’s a little sprocket icon in that bar for settings. Click on that, and you’ll get the following window to open.
Check the box that says Open link in a new tab. Most browsers will open the link in a tab, instead of an entirely separate window.
The code way
If you like to use code or are curious, you can make a link open in a new window, in WordPress, or any other website by using the following:
<a href="YOURURLLINKHERE" target="_blank">YOURLINKTITLEHERE</a>
(Note: Add your own website link or URL to the YOURURLLINKHERE part of the code, and the title of your link, instead of YOURLINKTITLEHERE.
The part that makes the link open in a new window is the target=”_blank”.
Easy peasy right?
Well, this isn’t the only place that most WordPress users may want to try making a link open in a new window. Widgets are also where you can add links. You can either use a text widget and code your own, or make a custom menu.
Make Custom Menu link open in a new window
To make a custom menu, you’ll need to go to Appearance > Menus, in your WordPress admin. By default, you can’t see the option to open the link in a new tab or window, so you will have to enable it by selecting the option in the screen options tab.
Once you have, create your custom menu, and add a link. You can click on the link that you added, and when it expands, you should see a checkbox to allow you to open that link in a new tab. Check that box, and then save the menu.
And that’s how you can get a a custom menu item link to open in a new window, in WordPress.
Hopefully that helps, if you’ve been trying to figure that out.
Amar kumar says
Hey Nile,
It is really very informative post. In WordPress every time an author wants to add a link in a post they have the option of selecting open link in new window.
Doing it manually is an option, there is a better way by using plugin – you can have all external links open in new windows automatically even if someone forgets to check the box. This tutorial is very helpful to understand whole mechanism. Eventually, thanks for sharing your valuable experience with us.
With best regards,
Amar kumar
Nile Flores says
Hi Amar!
You no longer need to use a plugin, since the option is in WordPress core. 😉
Manoj says
I am visiting your site first time. But now I found that it’s very useful for me. We have to configure the link each time to open it in a new tab or link. Otherwise, we should go for plugin options.
Thank you very much for this informative post.
Have a good day !
Nile Flores says
Hi Manoj! You shouldn’t need a plugin anymore for the option to open a link in a new window, since it is built into core, unless you are looking to put nofollow or some other type of target or rel.
Subhashree says
Hello Nile,
I am using wp external plugin for this. Because I don’t need to do the same thing again and again. It will make all external link open in new tab.
There is another option should have which is making link nofollow option.
Thank you
Rick Toney says
I started my simple website a couple of years ago and spent forever trying to figure out the basic aspects of wordpress. Mostly, I watched countless YouTube videos on this and that and slowly built my site. Not a fancy site or one trying to make money, but a placeholder on the net to show my business is real.
I ended up doing these links manually as there was not a plugin at the time to handle this for me. Or, at least I could not find one. I have used the code you show above and it works for me. I wish I had the information in your article when I was lost and confused.
Eva Smith says
Nice blog post about giving an access to another window for a link and its very necessary to do that because if the link is not given it will open in the same page. Nice blog post keep the good work going.
Eva Smith says
Nice blog post about redirecting any anchor link to new window because it doesn’t hamper the original page and opens in new window. Nice blog post keep the good work going.