function autoblank($text) { $return = str_replace('<a', '<a target="_blank"', $text); return $return; } add_filter('the_content', 'autoblank');