Support » Fixing WordPress » target="_blank" not opening in a new tab

  • Resolved ashmic


    I am trying to open a link into a new tab (by using target=”_blank” after my URL in the <a> tag) when clicked on and it’s not working. It either opens in the same window or it makes the page scroll down. Any ideas how to make it work?

    Here’s my page (note: it’s the STARx Pharmacy Portal link):

    Thanks for the help.

Viewing 3 replies - 1 through 3 (of 3 total)
  • esmi


    Forum Moderator

    Please do not open links in new windows or tabs without first warning visitors – in clear text on your site. At best, this behaviour will annoy visitors. At worst, it will completely strand some users in the new tab/window without any way to navigate back to your site because the Back button functionality has now been broken.

    esmi- Thanks for your input. I appreciate it. If this is the case, then how do you suggest I warn visitors? Do you have any step-by-step or examples you could show me?

    Note: This link I wanted to open in a new tab is a separate site for this company so it’s best viewed in it’s own tab. Normally, I wouldn’t just steer them away from the site but this is a special case.

    But, getting back to my question, how do I make the target attribute work in this instance? Any help would be greatly appreciated.




    Forum Moderator

    Ideally, the warning should be part of the link. So a link like “terms & conditions” would need to be adjusted to “terms & conditions (this link opens in a new window)”.

    so it’s best viewed in it’s own tab

    Sez who? Do you not think that your site visitors are quite capable of making that choice themselves using the controls in their own web browsers? As it stands, you’re trying to hijack those same browsers and taking the user’s choice of how to view links etc away from him/her. That’s a bit like me standing behind you and knocking your hand of your mouse every time you just wanted to click on a link & insisting you open the link in a new window instead. It’s annoying, frustrating and just darn wrong.

    Instead of forcing this upon users (some of who will have a very good reason to steer away from any new windows), why not just warn them using something like “terms & conditions (this page is best viewed in a new window)” and then let them chose?

    Apart from anything else, the approach you suggest will create insurmountable problems for some disabled users and, as equal web access for disabled people is often mandated by law, this could place your site on the wrong side of said law.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘target="_blank" not opening in a new tab’ is closed to new replies.