Is there a script that can be used in Webflow to automatically make all outbound links nofollow?

Published on
September 22, 2023

Yes, there is a script that can be used in Webflow to automatically make all outbound links nofollow. This script can be added to the project's custom code and will affect all the external links present on the website. Here's how you can do it:

  1. Go to your Webflow project and navigate to the Project Settings.
  2. In the Project Settings, click on the Custom Code tab.
  3. In the Head Code section, add the following script:
<script>  $(document).ready(function(){    $('a[href^="http://"]').attr('rel', 'nofollow');    $('a[href^="https://"]').attr('rel', 'nofollow');  });</script>
  1. Save the changes and publish your website.

This script will use jQuery to target all anchor tags (<a>) that have an href attribute starting with "http://" or "https://", and set their rel attribute to "nofollow". By doing this, search engines will not follow these links when crawling the website, which can be useful for preventing link juice from flowing out to other websites or for avoiding potential SEO issues.

Remember to test your website thoroughly after implementing this script to ensure that it doesn't affect any other functionality or links unintentionally.

Additional Questions:

  1. How do I add custom code in Webflow?
  2. What is the purpose of the "nofollow" attribute in SEO?
  3. Can I make specific external links in Webflow nofollow instead of all outbound links?