[wp-trac] [WordPress Trac] #61482: WordPress is adding rel="noopener" to code in normal texteditor

WordPress Trac noreply at wordpress.org
Mon Jun 24 06:56:55 UTC 2024


#61482: WordPress is adding rel="noopener" to code in normal texteditor
--------------------------+------------------------------
 Reporter:  neo2k23       |       Owner:  (none)
     Type:  defect (bug)  |      Status:  new
 Priority:  normal        |   Milestone:  Awaiting Review
Component:  General       |     Version:  trunk
 Severity:  normal        |  Resolution:
 Keywords:  needs-patch   |     Focuses:
--------------------------+------------------------------

Comment (by neo2k23):

 Replying to [comment:9 khokansardar]:
 > @neo2k23 in your case you can turn OFF the rel attribute from you anchor
 tag by removing below hook which one is added in wordpress for content
 formatting.
 >
 > {{{
 > // Remove hook modifying the rel attribute of targeted links on content
 save.
 > remove_filter( 'content_save_pre', 'wp_targeted_link_rel' );
 > }}}
 >
 > And test it again by adding your content -
 >
 > {{{
 > <a style="color:yellow" target="_blank" href="https://myforum.com">Goto
 the Forum</a>
 > }}}
 >
 >

 Thank you for the reply.

 That resolves the issue. I hope WordPress removes the filter once and for
 all. If not my last question remains:

 Isn't it a bug that also on target="_self" target="_parent" or
 target="_top" the rel="noopener" is added?

-- 
Ticket URL: <https://core.trac.wordpress.org/ticket/61482#comment:11>
WordPress Trac <https://core.trac.wordpress.org/>
WordPress publishing platform


More information about the wp-trac mailing list