|
/ Documentation /Developers Documentation/ Open External Links in New Tab

Open External Links in New Tab

Hook: surerank_open_external_links_in_new_tab

Description: The surerank_open_external_links_in_new_tab filter allows you to automatically add target=”_blank” to external links processed by SureRank on frontend output. This is useful when you want outbound links to open in a new tab without manually editing each link.

Source: inc/frontend/link-seo.php

Usage: Return true from this filter to enable the behavior.

Example:

add_filter( 'surerank_open_external_links_in_new_tab', '__return_true' );

Advanced example (conditional):

add_filter(
	'surerank_open_external_links_in_new_tab',
	static function( $enabled ) {
		if ( is_admin() ) {
			return $enabled;
		}

		// Enable only on singular posts and pages.
		return is_singular( [ 'post', 'page' ] );
	}
);

Notes:

  • Default value is false (disabled).
  • This changes rendered frontend output only, not stored post content.
  • Internal links and excluded domains are not modified by this filter.
  • If a link already has target=”_blank”, SureRank does not duplicate it.

Was this doc helpful?
What went wrong?

We don't respond to the article feedback, we use it to improve our support content.

Need help? Contact Support
Table of Contents
Scroll to Top