Skip to content

WordPress: Replace Target Plugin

Selecting “Open link in a new window” in the builtin WordPress WYSIWYG editor breack XHTML strict compliance by adding the attribute target=”_blank” to anchor tags. This plugin fixes the problem by replacing the target attribute with a common class attribute and then using a simple jquery script to open the link in a new window. This method allows for correct validation using XHTML 1.0 Strict.

Version 0.2: Feb 27, 2010
Updated to handle anchors that already have the class attribute.

Version 0.1: Feb 27, 2010
First version

replace-target.zip