Nofollow strategies for markdown sites

I touched on nofollow for Hugo-sites recently, but thinking about it a bit more, I wonder if it needs some kinda of failsafe setup. What happens if Hugo stops injecting the link parser? What happens if I move to a different setup and forget the link processor? What happens if … (insert paranoia here)

The goal of nofollow links is to avoid having search engines use them, but still to allow users to use them. How might that be doable?

(Side-note: the rel=nofollow has a number of usages. One of the most common use-cases (I’m guessing) is to clarify that a link there because of an exchange of value - for example, it might be an ad, or it might be an affiliate link. There are other use-cases, and other link-attributes, but I’m making too much of a fuss about this already, so I’ll leave it at rel=nofollow.)

The options

There might be others, this is what I came up with.

  • Write HTML. This is kinda straightforward. <a href="https://example.com" rel="nofollow">anchor</a> , right?
  • Append something to the end, eg https://example.com -> https://example.com#?
  • Prepend something to block the links, eg https://example.com -> #https://example.com
  • Use a bounce URL, eg https://example.com -> /bounce/?goto=https://example.com

Pros & amateurs

HTML

Pros:

  • Straightforward. It’s just HTML.
  • It’s the well-defined implementation, with or without processing

Cons:

  • Gotta write clean HTML
  • Reading posts is hard
  • It’s no longer markdown, eh

Verdict: If all fails, use this.

Append annotation

Setup: append an annotation that doesn’t block the direct clicking of the URL, but which can be caught by a pre-processor and turned into a nofollow link. Use something like # to avoid affecting the destination.

Pros:

  • Just works without processing

Cons:

  • Nofollow is dropped if processing fails

Verdict: Fine if you don’t strongly care about nofollow (if dropping a nofollow doesn’t bug you, should something fail). Not caring about nofollow seems to go against why I’m setting this up, so … meh.

Prepend annotation

Setup: Prepend an annotation that drops the link should processing fail. Use something like # to break the link completely.

Pros:

  • Safe if processing fails

Cons:

  • Doesn’t work for users if processing fails

Verdict: Not having links work for users should processing fails seems annoying. Skip this.

Bounce-pad

Setup: Create a page that redirects to the destination. Block the bounce-URL with robots.txt. On the bounce-URL, recognize a parameter that points at the final URL and redirect as appropriate. Block the bounce URLs with robots.txt to prevent any crawling. Add a noindex, nofollow in case the robots.txt doesn’t get uploaded. Have the site-generator swap out the bounce-URL against a normal nofollow link.

Pros:

  • Kinda easy to use, just prepend the bounce URL to links.
  • Don’t need to worry about the site generator forgetting to add rel=nofollow

Cons:

  • Needs protection against abuse
  • Uses code on the bounce URL + in the site generator.
  • Overall most complex setup to create (robots.txt, bounce URL, link generator changes).

Verdict: Works for me. It’s implemented here.

Don’t forget

If you’re messing with nofollow links on your site, make sure to add nofollow link highlighting to your browser, and add nofollow link-highlighting to your CSS.

Overall

  • HTML links work, are easy to keep, but writing HTML for every link is so archaic.
  • Appending something works, is pretty easy to code, but not Swiss-Bank-safe.
  • Prepending something is too flakey.
  • Bounce-pads are complex, but they work.

Which one to pick? Up to you.

Comments / questions

There's currently no commenting functionality here. If you'd like to comment, please use Twitter and @me there. Thanks!

Tweet about this - and/or - search for latest comments / top comments

Related pages