Open Social Media in New Tab

I almost always recommend opening links on your website in a new browser tab. If you do not it is easy for users to leave yoru website and not come back to it. By opening the link in a new tab, when the user is done with that tab they can close it and be returned to your website.


By default, Divi’s social media links open in the same window as yoru website. This can be changed by doing the following:

  1. In your WP admin, hover over Divi on the left sidebar and choose Theme Options
  2. Click on the Integration tab
  3. Make sure ‘Enable body code’ is enabled.
  4. Scroll down to the section where it says ‘Add code to the <body>’
  5. Add the JavaScript code below. If you already have some JavaScript there, you can just put this inside the existing <script> tags. If there is nothing there then make sure to wrap the JavaScript with <script> tags.
    $('.et-social-icon .icon').each(function(){
        $(this).attr('target', 'blank');

Need some help with your IT?

Scroll to Top
Call Now Button