Redirect 301 in a new tab/window

Jon Imms
Jon Imms used Ask the Experts™
Hi All,

I am trying to figure out how to get a 301 redirect in Wordpress to open in a new window?

I am using the Simple 301 Redirect tool with Wordpress

My website -- On the sidebar, I have a redirect in place for the Apply Now link. The only problem, is it opens in the same window, I'd like it to redirect to the new site in a new tab/window.  

Is this possible, and if so, how?
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Lucas BishopMarketing Technologist

Target the window to "_blank":

Here is your current code:
<a href="">Apply Now</a>

Open in new window

With target _blank:
<a href="" target="_blank">Apply Now</a>

Open in new window

Jon ImmsWeb Developer


I understand  target="_blank.

For this though, The site automatically creates the pages menu in the sidebar. I'm then redirecting the link to another site using 301. so i cannot use target="_blank
Lucas BishopMarketing Technologist

Targeting is how this is done. It sounds like your issue is actually with the system hat manages your navigation. Is there no way to specify a target in the system that manages your navigation? That's what you need to be addressing.
Most Valuable Expert 2017
Distinguished Expert 2018
You can bolt on a JavaScript event handler that will work against your rendered menu. Something like this
$('.nested_nav').on('click','.page_item .page-item-95 a', function(e) {
  var url = this.href;,'_blank');

Open in new window

Note, I have used page-item-95 as that is the class that is shown in the rendered page - if you change your menu this class may change which means the script will have to change.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial