WP adding noopener and noreferrer to all links

So WordPress provides a way to adjust these programmatically, but it’s done at the time of post save, not post render, so the changes will only apply once you add the code snippet to your site, and the go and re-save your post(s).

And, it’s only available from WP 5.1+

Here’s the code snippet (add it to your themes functions.php if you don’t have any other way already)


        add_filter( 'wp_targeted_link_rel', function ( $sRels ) {
            $aRels = preg_split( '#\s+#', $sRels );
            if ( is_array( $aRels ) ) {
                $nKey = array_search( 'noreferrer', array_map( 'strtolower', $sRels ) );
                if ( is_numeric( $nKey ) ) {
                    unset( $aRels[ $nKey ] );
                }
                $sRels = implode( ' ', $aRels );
            }
            return $sRels;
        }, 10000 );

Again, once this is added to your site, then you’ll need to manually go in and re-save your post(s) and this should update your links by removing noreferrer.