Can't seem to get Auto Tagging to work

I have added several words under the auto tagging area of watched words.

However creating a new topic and having any of these words in the title or body of the post doesn’t seem to set any auto tags. I assume I must be doing something wrong, but no clue as to what.

Is this not how the feature works?


Does anyone else have this working?

1 Like

Same, it’s not working for me either (the ‘test’ works but not in actual topic creation).

I wanted to check to see if it wors for the title as well as the post and whether it appends the tags to the tag field on typing i.e before the user clicks on submit. This would allow them to remove a tag if they don’t think it is suitable.

1 Like

Well for a feature they just rolled out you’d think it would be working. :smiley:

I just did a quick test of this on my local development site. When I add an auto-tag watched word, the test works for me, but so far I haven’t been able to get it to auto tag a topic when a post contains one of the watched words. I’ll look into this some more.

Edit: I did a quick test of this on a hosted Discourse site and am running into similar issues to what I’m seeing on my development site. Testing this on my dev site, what I’m finding is that the auto_tag method isn’t being called when I create a new topic that contains an auto-tag word. If I edit an existing topic to add an auto-tag word, the auto_tag method is called and the topic gets tagged.

I’ll move this topic to the bug category.


I did just note that on an embedded topic import from a remote site the auto-tagging did work. I thought maybe it had been patched, but tried it on a normal new topic creation and no joy. So it’s working partially anyway.

1 Like

I came here with the same issue (auto-tagging is not triggering when creating a new topic with watched words). But I also can’t get the tags to be added when editing an existing post.

I did a few changes to this feature a few weeks ago and I am expecting these issues to be fixed. Are you still having trouble with it?


Thx. I need to upgrade. I’ll test later today.

1 Like

Having tried again it still seems broken to me.

  • Regex “PSYC611” does not match this text in a new topic
  • Neither does the regex “psy(c?)6\d{2,3}” (which is what I would like to use
  • The “test” popup doesn’t match any tags, no matter what the input

Interestingly, when I look in the console, typing any text into the ‘test’ box on this page gives this error:

[Error] SyntaxError: Invalid regular expression: nothing to repeat
	RegExp (admin-355470031debabd8f424394656ad96526be89c17169165b65dc4fc52262cabf7.js:1:255499)
	matches (admin-355470031debabd8f424394656ad96526be89c17169165b65dc4fc52262cabf7.js:1:255499)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:201058)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:114334)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:113340)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:415053)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:407829)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:421290)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:458048)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:462227)
	De (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:187812)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:146212)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:146530)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:147093)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:488589)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:487600)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:489624)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:494999)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:491569)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:495515)
	(anonymous function) (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:311475)
	dispatch (ember_jquery-36a23101c869ab0dc53fc908de69adb785731593573d32bdeef416acc1076ef4.js:1:42931)

I pushed a few more fixes which I think will fix your latest issues. Can you upgrade and check this again?

I’m on 2.7.0.beta9. Have tried git pull and no changes there…

Oh, it is not in beta yet because I just pushed the changes. You can test it if you update to tests-passed.

1 Like

Ah sorry… Will have to wait to test as we don’t have a staging env. at present.

Turns out I was on tests passed, but for some reason it took a while to be visible na upgrade. Either way I am not on 2.8.0.beta1 db7038e6c2 and have tested again. I still have issues with the js. These are the tags I’m using:

(The UI would be much better as a list — this grid gets unwieldy when using many tags)

This is what the test box looks like:

And this is the error in the js console:

Browser is Safari Version 14.0 (15610., 15610).

1 Like

I understand now. You have an error in your first regular expression. You have “\d+{1,3}” which is invalid. Did you mean “\d{1,3}”?


Agh - sorry. Thanks for catching that. It works fine now.

I wonder if catching errors and warning the user would be helpful — especially as non technical people might inadvertently write strings that are invalid regexes? It would also be great if an error in one regex didn’t cascade to the others. In this case there were valid matches with some of the later regexes which didn’t get found because of the error in the first.


Is there anything we can do here to let users know when they are shooting themselves in the foot with regular expressions @sam? Can we put regex behind an advanced mode? Can we default to word boundaries which is what most people want when they put a word in, anyway?


Seems to be working for me even on my colon or slash elements now (ie: 1:35, 1/35)


1 Like

My call would be simply not to need full on regular expressions and support enough stuff out-of-the-box so only 1 out of 10,000 communities need to get hands dirty and use regular expressions.

In this particular example by @ben if we supported ? then:

PSY7?? → masters
PSY6?? → stage4
PSYC7?? → masters
PSYC6?? → stage4

Going to close this off cause it seems like the feature is working. (yes regex is richer, but this seems good enough to capture what Ben is trying to do)