• Hi,

    I need to add rel=’noopener noreferrer’ tag to external social links from my site.

    Specifically here for each of the social icons (FB, LinkedIn, Twitter etc.)
    https://ibb.co/YLsJ9k5

    How do I insert the tag to those a href links?

    Please help

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Hi,
    open part-social-icons.php and replace

    	echo sprintf( '<li><a href="%s" %s><i class="fa %s"></i></a></li>',
    							esc_url( $used[ $network['name'] ] ),
    							$target,
    							esc_attr( $network['icon'] )
    						);

    with this

    	echo sprintf( '<li><a  rel="noopener noreferrer" href="%s" %s><i class="fa %s"></i></a></li>',
    							esc_url( $used[ $network['name'] ] ),
    							$target,
    							esc_attr( $network['icon'] )
    						);

    and
    <li><a href="<?php echo esc_url( get_theme_mod( 'rss_feed', get_bloginfo( 'rss2_url' ) ) ); ?>" <?php echo $target; ?>><i class="fa fa-rss"></i></a></li>
    with
    <li><a rel="noopener noreferrer" href="<?php echo esc_url( get_theme_mod( 'rss_feed', get_bloginfo( 'rss2_url' ) ) ); ?>" <?php echo $target; ?>><i class="fa fa-rss"></i></a></li>

    If you decide to proceed with this modification I would suggest you create a child theme, copy over the files you are editing and make the modifications there. This will allow your changes to survive future theme updates. If you directly edit the theme’s files, all changes will be lost once you update.

    Have a look at this guide to learn more about child themes and how to create one https://www.cssigniter.com/ignite/beginners-guide-child-themes/

    Let me know if you need additional help with this.

    Thread Starter ravikirans

    (@ravikirans)

    Thank you. Able to resolve the issues

    Thread Starter ravikirans

    (@ravikirans)

    Hello Fotis,

    There a link where Google complains that it is not crawlable. I think it refers to this link where href attribute is not there for an anchor ‘a’ link.

    https://ibb.co/F0tW7yn

    When I inspect, it is in the mobile version. I am not able to find where to update. Please guide.

    https://ibb.co/26JzswD

    I need to add href attribute to this link, so resolve all the SEO errors. Thanks a lot for helping out

    Hi,
    This link should not be crawlable, it does not contain any href.
    This is also part of the mobile menu and cannot be changed I am afraid since its a third party script. Please do update the theme, since we remove this mobile menu script in our latest version of Olsen light

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Need to add noreferrer tags to social links’ is closed to new replies.