Title: WordPress removing target attributes
Last modified: August 18, 2016

---

# WordPress removing target attributes

 *  [pixelgeek](https://wordpress.org/support/users/pixelgeek/)
 * (@pixelgeek)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/)
 * Can anyone think of any reason why worpdress would be removing the target attribute
   from anchors?
 * I have a series of posts where we enter ‘target=”_blank”‘ in the anchor but after
   saving it the target attributes are removed.
 * We’ve run into this problem using the web based editor as well as the xmlrpc 
   interface
 * TIA

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/wordpress-removing-target-attributes/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wordpress-removing-target-attributes/page/2/?output_format=md)

 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359631)
 * If you’re using the wysiwyg, yes, this will happen. Try when needing to add the
   target attribute disabling the wysiwyg for that post.
 *  Thread Starter [pixelgeek](https://wordpress.org/support/users/pixelgeek/)
 * (@pixelgeek)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359643)
 * >> If you’re using the wysiwyg, yes, this will happen.
 * This happens even when using the xmlrpc interface.
 * Is there some way to disable this as it seems rather heavy-handed to be messing
   with my HTML
 *  Thread Starter [pixelgeek](https://wordpress.org/support/users/pixelgeek/)
 * (@pixelgeek)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359644)
 * >> If you’re using the wysiwyg, yes, this will happen.
 * So why the heck does the WYSIWYG editor have an option to do this? I can add 
   the target attribute in the WYSIWYG editor and then it just removes it?
 * That doesn’t make any sense at all.
 *  Thread Starter [pixelgeek](https://wordpress.org/support/users/pixelgeek/)
 * (@pixelgeek)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359646)
 * Just confirmed it. Add a link with a target attribute in the WYSIWYG editor and
   then save it and the editor removes the attribute.
 * Where do you report bugs and does anyone know of a fix for this?
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359648)
 * Is it a bug, per se? Or is it a case where the editor is trying to keep your 
   xhtml compliant?
 * Out of curiosity, what happens if you go to Options -> Writing and uncheck the
   option: `"WordPress should correct invalidly nested XHTML automatically"`?
 * Same or different behavior?
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359649)
 * Bugs to: [http://trac.wordpress.org/](http://trac.wordpress.org/)
 * I don’t know what the “xmlrpc interface” is or does, but usually you can get 
   around the stripping code problem by disabling the wysiwyg editor and using the
   normal one.
 *  Thread Starter [pixelgeek](https://wordpress.org/support/users/pixelgeek/)
 * (@pixelgeek)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359650)
 * >> Is it a bug, per se?
 * If the editor adds a tag attribute and then rips it out then I can’t see that
   it is anything other than a bug.
 * >> Out of curiosity, what happens if you go to Options -> Writing and uncheck
   the option: “WordPress should correct invalidly nested XHTML automatically”?
 * Its not checked.
 * The bug only happens, it appears, when I add a post with the WYSIWYG editor. 
   I’ve added a draft post using w.bloggar and then editied it repeatedly and while
   the editor does indeed modify the HTMl adn moves the tag it does not remove it.
 * I need to confirm this with another site author who is using ecto on the Mac.
 * It only removes it, AFAICT, when I use the WYSIWYG editor.
 *  Thread Starter [pixelgeek](https://wordpress.org/support/users/pixelgeek/)
 * (@pixelgeek)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359653)
 * >> I don’t know what the “xmlrpc interface” is or does, but usually you can get
   around the stripping code problem by disabling the wysiwyg editor and using the
   normal one.
 * Well if I’m going to do that then I’ll just not use the web based editor at all
   as its a bit of a PITA to edit anything other than a small post in the text view
   of the web based editor.
 *  [Chris_K](https://wordpress.org/support/users/handysolo/)
 * (@handysolo)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359654)
 * Well yeah, not to digress but… I’ll agree. I think the wysiwyg thing delivered
   with 2.x is the devil.
 * The non-wysiwyg one is tolerable for shorter articles.
 * Otherwise, I tend to use the [Performancing plugin for Firefox](http://performancing.com/firefox)
   or w.bloggar.
 * Sorry for the digression. 🙂
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359656)
 * pixelgeek: yes, it’s all a PITA. For short posts, the plain ol’ plain ol’ works
   okay (at least for me – I don’t post graphics, music, video etc. – and I have
   autolinks for links, or in a pinch the quickbutton for links works fine). For
   longer posts I compose in notepad2, then upload using the plain html interface.
 * Occasionally, I’ve been known to go into the database to edit a post, depending
   on situation.
 * But really, the wysiwyg shipped with 2.0.2 is fair useless.
 *  Thread Starter [pixelgeek](https://wordpress.org/support/users/pixelgeek/)
 * (@pixelgeek)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359664)
 * >> But really, the wysiwyg shipped with 2.0.2 is fair useless.
 * Is it a new feature or did it just not get tested before the release?
 *  [vkaryl](https://wordpress.org/support/users/vkaryl/)
 * (@vkaryl)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359671)
 * Well, it’s new in the 2.0 branch. As to testing, I couldn’t really say. One assumes
   things get tested. This has so many bugs, one would equally assume one was wrong….
 * All I really know about the wysiwyg is that I’ve had the same one on other programs
   I use, it’s always been a POS, so even if I’d WANTED to use a wysiwyg with WP,
   I would have given this one a pass.
 * But that’s just me: while I don’t hand code, I can so I know what’s good coding.
   The included wysiwyg doesn’t produce good code. One could justify that by saying“
   it makes posting life SO much easier for those who aren’t web-savvy” or whatever.
   But since it does just the opposite, it’s a complete bust.
 *  [Sushubh](https://wordpress.org/support/users/sushubh/)
 * (@sushubh)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-359672)
 * i had say the rich text editor should not be the default option in the blog. 
   it sucks to disable it for new users added to the blog…
 *  Thread Starter [pixelgeek](https://wordpress.org/support/users/pixelgeek/)
 * (@pixelgeek)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-360008)
 * It appears that this happens no matter what editor or input method you use as
   long as the authors are not at least an Editor.
 * Somewhere in the code the backend strips out attributes from anchors
 *  [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * (@pizdin_dim)
 * [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/#post-360012)
 * > _Is it a bug, per se?_
 * I don’t use the RTE nor am I familiar with it but it’s **very likely** to be **
   by deliberate design** and not a bug at all.
 * Unless, of course, it deliberately claims to produce non XHTML compliant code,
   which is pretty unlikely. Keep in mind that in XHTML the _target_ attribute is
   depreciated and is destined to be as dead as disco one day.

Viewing 15 replies - 1 through 15 (of 17 total)

1 [2](https://wordpress.org/support/topic/wordpress-removing-target-attributes/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/wordpress-removing-target-attributes/page/2/?output_format=md)

The topic ‘WordPress removing target attributes’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 17 replies
 * 5 participants
 * Last reply from: [Pizdin Dim](https://wordpress.org/support/users/pizdin_dim/)
 * Last activity: [20 years, 4 months ago](https://wordpress.org/support/topic/wordpress-removing-target-attributes/page/2/#post-360015)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
