WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm trying to make every attachment link open in a new tab/window but checking the 'Open link in a new tab' checkbox in the post editor or adding target="_blank" manually doesn't seem to work. Links always open in the same window.

According to this topic the editor is stripping the target attribute.

Any ideas on how I can get this to work?


share|improve this question

Presuming you don't have a blank install have you tried disabling all your active plugins to see if it might be a conflict?

If you can set the links to open in a new window when no plugins are active then activate one plugin at a time to figure out the culprit.

Also check if your plugins, themes, wordpress are in need of updates.

Don't forget to backup first.

share|improve this answer

Be wary with the thread you referenced as it is over 6 years old! WordPress has changed significantly since then!

In addition to what the previous answered suggested, also check your browser to ensure that you can open up in new tabs/windows. Will this happen on another site? You may have hit some setting that always opens up a new window in the current window (i.e., the browser is overriding the attribute).

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.