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 How to: Setup Password & Share url - Insert Custom CSS - Page Header - Upload Custom Font - Upload File - Find Block ID - Contact Customer Care 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
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment