Skip to content
This repository has been archived by the owner. It is now read-only.
Adds nofollow attribute to all external links in your hexo blog posts automatically.
Branch: master
Clone or download
Pull request Compare This branch is 61 commits ahead of liuzc:master.
curbengh Merge pull request #8 from curbengh/deprecate
docs: add deprecation notice
Latest commit 9675cd1 Sep 3, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib refactor: replace cheerio with regex Aug 22, 2019
.npmrc chore: disable package-lock.json Apr 24, 2019
.travis.yml chore: remove snyk and greenkeeper Aug 22, 2019
LICENSE docs: update username in license Jul 18, 2019 docs: add deprecation notice Sep 3, 2019
index.js style: standard Aug 9, 2019
package.json release: v2.0.0 Aug 22, 2019



This plugin has been deprecated. I'm now working on hexo-filter-nofollow.

If you prefer this plugin and doesn't want to see the deprecation warning,

-  "hexo-nofollow": "^2.0.0"
+  "hexo-nofollow": "curbengh/hexo-nofollow"

npm version Build Status

Adds nofollow attribute to all external links in your hexo blog posts automatically.

This is an updated version of hexo-autonofollow. All the options are the same, so you can use this as a drop-in replacement.


  • Add rel="external nofollow noopener noreferrer" to all external links for security, privacy and SEO. Read more.
  • Add target="_blank", Open external links in new window or tab. This can be disabled, see below.

Hexo doesn't insert target="_blank" to all external links even if you set external_link: true (default value) in the _config.yml. This plugin make sure all external links are processed.

For example,



<a href="" rel="external nofollow noopener noreferrer" target="_blank">example-link</a>


$ npm install hexo-nofollow --save


To enable this plugin, insert the following to _config.yml:

  enable: true

To exclude certain links, see below.


  enable: true
    - ''
    - ''
external_link: true
  • enable - Enable the plugin. Defaults to false.
  • exclude - Exclude hostname. Specify subdomain when applicable, including www
    • '' does not apply to nor
  • external_link - Add target="_blank". Defaults to true. Recommend to set it to false.

Note: external_link setting is already in the default _config.yml.


All credits go to the following work:

You can’t perform that action at this time.