Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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?

Thanks

share|improve this question
add comment

2 Answers

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
add comment

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
add comment

Your Answer

 
discard

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.