Add noopener to links that open in a new tab

To fix it I opened the file:
wp-content/plugins/elementor/includes/widgets/button.php

And changed:

if ( $settings['link']['is_external'] ) {
    $this->add_render_attribute( 'button', 'target', '_blank' );
}
if ( $settings['link']['nofollow'] ) {
    $this->add_render_attribute( 'button', 'rel', 'nofollow' );
}

To:

if ( $settings['link']['is_external'] && $settings['link']['nofollow'] ) {
	$this->add_render_attribute( 'button', 'target', '_blank' );
	$this->add_render_attribute( 'button', 'rel', 'noopener' );
} else {
	if ( $settings['link']['is_external'] ) {
		$this->add_render_attribute( 'button', 'target', '_blank' );
	}
	if ( $settings['link']['nofollow'] ) {
		$this->add_render_attribute( 'button', 'rel', 'nofollow' );
	}
}
Share on facebook
Share on google
Share on twitter
Share on linkedin
Share on whatsapp