Topic auto tagging

See how Wikibots are working at Wikipedia, it is a good reference model… Other important criteria to policy and implementation:

  • to be an assisted agent: never (or very rare) an automatic classification with no human confirming it. Must work “by (assisted) lot” not in a continous (by demand) way.

  • to be specialized: never generic, need a scope and limited (configurable/controlable) range.

  • to be symmetric over validation: an human can be also use the same tag, the robot (software agent) is not the only autorithy to tagging its scope. So two cenarios: 1. robot tagging and human validating/confirming (or warning to vote). 2. human tagging, and robot valiating (or warning to other human confirm).

Whith this basic polices the robot is viable in any community!

Other suggestion: when the scope is specific, or when the “easy to tag” generates “tag pollution”, the best is to use different color to the tags of the bot-scope. EXAMPLE: tagging languages in a multilingual community as

1 Like

Now that we have watched words that trigger certain actions, wouldn’t it be easy to simply add “tag” as a possible action to perform upon a matched word/regex?


It’s a feature that is closer to being implemented now, yes. “Simply adding tag” isn’t quite the whole story. Each watched word needs to also specify which tag to add, for example.


That would be absolutely awesome! Especially if it’s not just words but also regular expressions. Auto-tagging based on regular expressions would bring tags in discourse to a whole new level!

Yes, and I also realize that the existing actions apply to posts while tags can only be applied to topics. So the question is: will tagging actions only be based on the first post? Or can any reply also trigger the tag? Or will it be a setting, whether it applies to both?..

Did anyone endup building this as a plugin?

@vinothkannans is currently working on something along these lines for PMs. I’m not sure how much extra work there would be to make it fit this brief – can you comment Vinoth?

You can create a plugin with the below simple code. But the difficulty level is fully depends upon your auto tagging logic/requirement.

DiscourseEvent.on(:topic_created) do |topic|
  guardian =
  DiscourseTagging.tag_topic_by_names(topic, guardian, ["bug"], append: true) if topic.title.match(/bug/)

@syl solved this with definable auto-tagging in his Docus plugin. I suspect someone could pull that function out to create auto-tagging if he didn’t mind.

from my perspective the most obvious solution would be for a post to be auto-tagged with the tag(s) that the user is currently on (tag-page, or post). This makes it obvious visually to the user how the feature works if they need to change it, and in most cases it will probably be correct as they will be replying to something with the tags they are replying to.


Correct me if I’m wrong, but it looks like @pfaffman implemented this plugin at

1 Like

I did. It just assigns a tag to every topic created in a category, but it’s a good start on something that could apply tags depending on topic content, I suppose.


+1 this would be a really useful feature or plugin, auto tagging based on watched words (each with an assigned tag) that exist in the topic (title/body).

1 Like

That’s certainly possible in a plugin. You could use my plugin above as a starting place or ask in #marketplace


Can you share a link to your plugin, @pfaffman?

1 Like

I want to automatically tag all topics that contain video urls (regex from a list?) in the first post with a “video” tag and display those video tag pages in each category with masonry css and thumbnails. How to achieve that?

1 Like

This would indeed be cool. Especially in combination with the RSS plugin. It’s then possible to auto tag certain autocreated posts. Which provides hands free auto injection and indexing of topics. Creating a true automatic knowledge base for the community.

Auto-tagging is really problematic issue. It teaches everyone, users and admins, to use tags such way that leads to situation where no one is not actually using tags.

Everything just because bot will tag everyhing where is one keyword, even when that post isn’t relevant.

In this topic can found three main reasons to use tags:

  • sub-category other than topicwise (like tagging all videos; users seldom searches just videos, so this is just for admin and even he/she doesn’t really needs it)
  • detailed search used as menutype element (like tagging iPhone; users never want to find everything under keyword iPhone, they want to know something like why discourse app crashes on iPhone)
  • vertical taxonomy expanding categories using structure that helps a user, not admin as tagging is quite often builded (that can’t be automated easily with normal tools, perhaps somekind AI can solve this out someday)

Because of constantly misuse of tags, tag pollution and hashtags like Instagram, users have learned not to use tags. Tags should narrowing hits, make things more spesific, not expanding.

This topic (and Meta itself quite often) is an good/bad example. How many relevant used tags you can find?


It’s quite an old topic :slight_smile: My specific need was to “almost” auto-tag topics… meaning I would have specified what exact tags I want (iphone, ipad, macbook, macbookpro, macbookair etc) and then if Topic title had for example word “iphone” in it, it would be tagged automatically. And this category was strictly buy/sell category so… it would have been great to filter by “iphone” tag to get all the topics where iPhone was sold. But we managed without it actually :wink:

Yes it is :sweat_smile: But right away when happends two things, as a new post or automatic bump by forum, the topic will be relevant.

But the main question itself is evergreen.

I understand what you were looking for, and this is fundamentalistic (is that even a word in english?) problem in websites in general - using tags when search is better and a tag will give unrelated hits.

Discourse itself is an issue too. Because lack of sub-sub-categories even docs teach to use tags as catgories and that is wrong in so many ways.

But… now I’m repeating myself. And that is more wrong than misuse of tags :rofl:

This is now implemented per: settings->customize->watched words->tag