Earlier this week a regular attendee of my Social Media Cafes, reached out for some assistance with their Divi themed WordPress website. They were struggling to get their social media icon links to open in a new tab.

Divi is an awesome theme that is flexible and super easy to use, allowing anyone to create a professional-looking website, but every now and them the Divi Options and Theme Customiser falls short and your need to know a trick or two.

Why Should Social Media Icons Open In A New Tab?

You will have seen this time and again whilst browsing websites, and probably not given it a second thought. External links, those that take you to another website, generally open in a new tab or window. The main reason for this is simple – you want to keep your website visitors for as long as possible. Let’s face it the longer they are looking at your website the more chance you have to engage with them and hopefully convert them to a customer, get them to sign up to your newsletter or send an online enquiry.

Divi Theme: How to Make Social Media Icons Open in new tab | The Social Media Consultancy Limited helping demystify digital marketing

So, how do you make Divi social media icons open in a new tab?

Well, there is a really quick and simple solution for this and doesn’t require any coding knowledge and only takes a few minutes to complete. All you need is 5 very short lines of coding, which you can simply copy and paste into the appropriate area of your Divi dashboard.

  1. Login to your WordPress admin
  2. Hover over ‘Divi’ and click ‘Theme Options
  3. Click ‘Integrations
  4. Scroll down to ‘Add code to the < body > of your blog’ and in the box paste the following code:
<script type="text/javascript">
jQuery(document).ready(function($) {
jQuery(".et-social-icon a").attr('target', 'blank');
});
</script>
  1. Now, scroll down the page and click the ‘Save Changes‘ button

That’s all there is to do – your Divi social media icons will now all open in a new tab.


Please be advised that this post contains affiliate links.


How to make social media icons open in a new tab

Read Time: 2 min