discourse seo is a custom tool for custom SEO-focused modifications over Discourse.
This plugin currently adds an X-Robots-Tag: noindex response header to topic pages when a topic belongs to selected categories, helping you control what search engines can index.
Add discourse seo to your Discourse container's app.yml:
hooks:
after_code:
- exec:
cd: $home/plugins
cmd:
- git clone https://github.com/gorfist/discourse-seo.gitRebuild Discourse:
cd /var/discourse
./launcher rebuild appIn Discourse admin settings:
- Enable
discourse category topic noindex enabled. - Select categories in
category topic noindex categories. - Choose canonical behavior in
canonical topic post urls:self(default):/t/topic/16654/6keeps canonical/t/topic/16654/6topic_root:/t/topic/16654/6uses canonical/t/topic/16654
Every topic in a selected category will return:
X-Robots-Tag: noindexThe tool also honors the legacy topic custom field noindex, so topics previously marked by discourse-topic-noindex continue to receive the header.
discourse seo can override canonical tags for topic post URLs without redirecting or changing route structure.
canonical_topic_post_urls = self: each post URL remains self-canonical.canonical_topic_post_urls = topic_root: post URLs canonicalize to the topic root URL.
Included locales:
- English:
config/locales/server.en.yml - Persian:
config/locales/server.fa_IR.yml