A bug has been identified regarding how Discourse handles user profile visibility and robots.txt when ‘Hide user profiles from public’ is enabled. RGJ initially questioned why /u isn’t disallowed in robots.txt, noting that search engines receive 403 errors instead of seeing noindex headers — potentially harming SEO. While Meta is the only known instance with Disallow: /u, Moin suggested it may be customized, bypassing recent migrations. RGJ confirmed this is a bug, referencing a 2022 PR (#27712) that moved noindex header injection to before_action to ensure it triggers even on 403s. However, the fix is incomplete: while /u/username correctly returns x-robots-tag: noindex, /u/username/summary does not — indicating inconsistent behavior. The issue stems from the hardcoded list of paths in robots_txt_controller.rb that are meant to receive noindex headers, but the logic fails to apply universally. This bug affects search engine indexing of user profile subpages and requires further patching to ensure consistent noindex headers across all /u/* routes.
If “Hide user profiles from public” is checked, shouldn’t /u be disallowed in robots.txt ?
Otherwise search engines will hit a 403 which might affect ranking and visibility.
Unfortunately, that does not always work. While /u/rgj does have a x-robots-tag: noindex header, /u/rgj/summary does not, so it seems like the most recent change is having some unwanted side effects.