|
/ 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' );

Add the example to your child theme’s functions.php file or a PHP snippets plugin, then verify an external link on the frontend. Conditional checks such as is_singular() may run before the main query is ready, so do not rely on them in this filter without testing hook timing.

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