Remove Canonical Link Plugin

This plugin might just might be one of the “the most simple (but useful) plugins for Discourse” on the planet (well, for me at least) :slight_smile:

Basically, for reasons I have explained in this post I wrote and tested this plugin this morning to:

  1. Demonstrate how easy it is to override a Ruby module in a Discourse plugin.
  2. Remove all canonical links from our Discourse instance (for reasons explained here).

I realize that the vast majority of Discourse sites will never have a reason to use this plugin; but the simplicity of it helps beginning Discourse plugin developers understand how easy it is to override a method in a Ruby module (via a Discourse plugin) to do similar sys admin tasks.

Frankly, I’ve been working on learning Ruby, Rails and Discourse plugins for a few months now, and feel like I have read just about every Discourse plugin on Github and all the plugin tutorials on meta.

What has helped me the most lately has been to go back to the basic of Ruby and learn the basic concepts a Ruby person should know. I had never used Ruby before Discourse, and now I am starting to love Ruby so much.

Here is this simple plugin, which I hope other beginning plugin developers will appreciate.

It is so simple, please don’t laugh too much! :slight_smile:

https://github.com/unixneo/discourse-remove-canonical

FYI: I intentionally did not create a setting to turn it on and off to keep it simple. I mainly wanted to demonstrate how easy it is to override a module to accomplish a simple task so hopefully, other plugin noobs can benefit from my “step-by-step” learning Ruby basics.

7 Likes