A simple way to ensure all your advertising has “nofollow” tags on every page

Sometimes, you may not have access to your ad delivery network on your website, but the fact they are embedding ads in your pages without the rel=”nofollow” tag is costing your site in SEO. One thing you can do is insert this handy JQuery code in your page footer. All it does is wait for your page to load then it scans all your links for a match unique to the ad network and adds the “rel=’nofollow’ attribute in those matching

 tags.

Simply replace “ad-deliverer/” below to whatever unique part of the path you can use to identify your ad network, such as “doubleclick”.


$(document).ready(){

$("a").each(function(){

href=$(this).attr("href");

if (href.indexOf("ad-deliverer/")>-1){
$(this).attr("rel","nofollow");
}

});

});

About Author:

Senior Cloud Software Engineer and 25+ years experienced video production, video editing and 3D animation services for a variety of global clients including local video production here in Jacksonville, Florida.

Leave a Comment

Your email address will not be published. Required fields are marked *