How to Open Links in a New Tab

It is very easy to make your link open in new tab without using any plugin, but before making these changes, please make sure you are using  child theme

This doc cover three different request of opening link in new tab:

1) If you want to open all link available on your site in new tab then, open your header.php file and add this code just above </head>

<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function($){
    $('a').each(function(){
        if( $(this).attr('href') && 0 != $(this).attr('href').indexOf('#') ) {
            $(this).attr('target', '_blank');
        }
    });
});
// ]]></script>

2) If you want to open external link available on your site in new tab then, open your header.php file and add this code just above </head>

<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function($){
    $('a[href]:not([href^="ENTER YOUR SITE URL HERE"]):not([href^="#"]):not([href^="/"])').attr( 'target', '_blank' );
});
// ]]></script>

Make sure you replace " ENTER YOUR SITE URL HERE " with your site URL.

3) If you want to open any particular link on your site in new tab then, open your header.php file and add this code just above </head>

<script type="text/javascript">// <![CDATA[
jQuery(document).ready(function($){
    $('#footer .social li a').each(function(){
        if( $(this).attr('href') && 0 != $(this).attr('href').indexOf('#') ) {
            $(this).attr('target', '_blank');
        }
    });
});
// ]]></script>

Make sure you replace " #footer .social li a " with the particular class of which link you want to open in a new tab.

This video might come in handy if you are trying to open just a specific link in a new tab: