External Nofollow WordPress Plugin

External Nofollow WordPress Plugin

External Nofollow WordPress Plugin

External Nofollow is a WordPress SEO plugin which automatically add HTML attribute rel="nofollow" to all external links in post content.

Nofollow is used to instruct some search engines that a hyperlink should not influence the link target’s ranking in the search engine’s index. Using nofollow, we can control the flow of PageRank from our website to another.

Download External Nofollow WordPress Plugin

Download the latest version from WP.org

Installation and Usage

  • Unzip downloaded file and upload extracted folder to the /wp-content/plugins/ directory
  • Activate the plugin through the ‘Plugins’ menu in WordPress and enjoy.

The plugin does its job automatically. It will check each link in the post content, if the link begins with blog URL, then it’s passed; otherwise, the attribute rel="nofollow" will be added.

You don’t need to do anything. Just install and forget!


The plugin is improved from the code in the article WordPress Tip: Add nofollow to links in post content. I want to give big thank to WPExplorer, who encourage me to create this plugin.


  1. Hi, and thank you for this amazing plugin. I’ve searched a while till i found this one. Still, I do have a problem with it, let’s suppose I want to keep dofollow for one particular article.

    Could you consider adding a checkbox or something at the end of each article (admin post screen) so I may add dofollow for one of my clients?

    Eventually, could you please respond on how I may add this in the plugin php file? It should be a simple rule of: if this link then do follow, else default.

    Thank you

  2. Ok, i’ve found how to do this: open the php file

    (/external-nofollow.php) and search for the line

    $site_link = get_bloginfo(‘url’); in the callback function

    right after it add this line:

    if ( $_SERVER[“REQUEST_URI”] != ‘/archive/car-insurance-the-one-thing-car-addicts-cannot-overlook’)

    where /archive etc should be the url of your article.

    1. It would be nice to have an admin tool to add URLs you want to exclude from the “nofollow” plugin.

      My Workaround:
      If you want to exclude some external links from the “nofollow” function. You have to build this if-else around it. You have to change “domain.com, domain2.com, domain3.com” to the domains you want to exclude from the rule.

      function callback($matches)
      $link = $matches[0];
      $site_link = get_bloginfo(‘url’);

      if (preg_match(“/domain.com/i”, $link) || preg_match(“/domain2.com/i”, $link) || preg_match(“/domain3.com/i”, $link)){
      if (strpos($link, ‘rel’) === false) {
      $link = preg_replace(“%(href=S(?!$site_link))%i”, ‘rel=”nofollow” $1’, $link);
      } elseif (preg_match(“%href=S(?!$site_link)%i”, $link)) {
      $link = preg_replace(‘/rel=S(?!nofollow)S*/i’, ‘rel=”nofollow”‘, $link);

      return $link;

    1. This plugin works silently, e.g. just install and forget! To check, view source code of your post, and check for external link.

  3. Ideally I’d like a plugin to nofollow all links to chosen domains. In other words, if, say, I have Amazon links on my blog, I could simply enter the domain in a box and that would then make all links to Amazon nofollow.

    1. Hi, I discontinue developing this plugin. Instead, you can use the SEO Smart Links plugin, which has same functionality.

Comments are closed.