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?



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.


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).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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