• Currently, your plugin opens external links embedded in your plugin to open in the same page or window (“_self”).

    Please change your plugin’s external links to open in a new window or tab (“_blank”).

    If your plugin is properly designed, tab-napping, etc. should not be an issue once the change is implemented.

    Above condition mars activity taking place in our WP dashboard.

    Thank you!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter jetxpert

    (@jetxpert)

    Temporary Solution:

    To open all external links embedded in your website in a new window or tab, add the following script to the footer of your website: (i.e., Space before </body>)

    <script>
    jQuery(document).ready(function($) {
    	$('a')
    		.filter('[href^="https"], [href^="//"]')
    		.not('[href*="' + window.location.host + '"]')
    		.attr('rel', 'nofollow noopener noreferrer')
    		.attr('target', '_blank');
    });
    </script>

    Note: The above works with all external links embedded in your website (front-end) and most external links embedded in your website’s WP dashboard (back-end).

    Cheers!

    Thread Starter jetxpert

    (@jetxpert)

    Correction:

    Use this script instead: (added second filter for non-secure http URLs)

    <script>
    jQuery(document).ready(function($) {
    	$('a')
    		.filter('[href^="https"], [href^="//"]')
    		.filter('[href^="http"], [href^="//"]')
    		.not('[href*="' + window.location.host + '"]')
    		.attr('rel', 'nofollow noopener noreferrer')
    		.attr('target', '_blank');
    });
    </script>

    Cheers!

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘External Links Should Open in New Tab or Window’ is closed to new replies.