madzie Posted February 23, 2022 Share Posted February 23, 2022 Site URL: https://www.philippinestravelguides.com/ Hi I have used one of the code which explains how to make nofollow link on the website https://www.philippinestravelguides.com/ (Pass- HOPPFCL) now all URL's including my website Internal URL too has become nofollow. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.5.0/jquery.min.js"></script> <script> $(document).ready(function() { $("a").attr('rel','nofollow'); }); </script> What i noticed that squarespace use "Relative Link" instead of "Absolute Link" which the code cant identify internal vs external link so treating all link as external and marking them as nofollow. So, I want to know how i can make my Internal Url's Dofollow. Need help on this.. Thanks Link to comment
tuanphan Posted February 27, 2022 Share Posted February 27, 2022 Add this new code <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script> <script> $(document).ready(function() { $('a').attr('rel', function() { if(this.host == location.host) return '_dofollow' else return 'nofollow' }); }); </script> Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
madzie Posted February 28, 2022 Author Share Posted February 28, 2022 Thank you @tuanphanonce again for this code. It did solve my issues. Thank you so much! Link to comment
taylorwolfe Posted September 14, 2023 Share Posted September 14, 2023 Will this code by itself automatically make all internal links follow and all external nofollow? And does this go in the head of the site? Link to comment
tuanphan Posted September 17, 2023 Share Posted September 17, 2023 On 9/15/2023 at 4:06 AM, taylorwolfe said: Will this code by itself automatically make all internal links follow and all external nofollow? And does this go in the head of the site? Yes. Add to Settings > Developer Tools > Code Injection > Footer Email me if you have need any help (free, of course.). Answer within 24 hours. Or send to forum message Contact Customer Care - Learn CSS - Buy me a coffee (thank you!) Link to comment
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment