How to automatically replace a phrase in every topic title?

Hey there,
We use discourse as our discussion forums at https://discuss.openedx.org. I’m wondering if there is a solution to force the community to use the proper capitalization on our brand name. or automatically replace some keywords with the proper word.
The preferred typing of the brand name is Open edX but many people use open edx (all lowercase) or openedx instead.

There’s nothing built into Discourse to replace a phrase, but you might have some luck using Watched Words to automatically flag topics if Open edX is spelled incorrectly in a topic’s title. This is configured from your Admin / Logs / Watched Words section. If you enable the watched words regular expressions site setting, you can use regular expressions for watching words.

I tested this out on my own site earlier today and I’m having trouble getting watched word regular expressions to not ignore case. It seems that Discourse is setting the ignore case flag on the regular expressions. I’m not sure if there is a way to override that. If anyone has ideas about this, I’d like to know.

If this could be made to work, your staff would have to respond to flags for the watched words and then edit the posts. That may be more work than you are wanting them to do.

I suspect that it would be possible to create a theme component that would automatically re-write topic titles on the client, but since it would be running on every page load of every topic, it might be an inefficient approach.

2 Likes