Parent Category name is not shown in sub category page title

AI-generated summary

Parent Category name not shown in sub category page title

Anil_Gupta reported an issue where the parent category name is not displayed in the page title of a subcategory page. They expected the page title to include the parent category name, such as Parent Category → SubCategory, to avoid duplication of page titles for subcategories with the same name under different parent categories, which affects SEO.

codinghorror acknowledged the issue and considered it a minor optimization. joffreyjaffeux provided a fix in a GitHub pull request, which was later merged. The fix will display the parent category name in the title anchor, such as “Latest PARENT CAT/SUB CAT topics - SITE TITLE”, when browsing a subcategory page. The fix is available for self-hosted sites on the Tests-passed branch and will be included in the next release.

I am not sure if this is a bug or I am missing any admin setting.

I tried Admin setting:

It does show the category name when I am on category page.

But, If i am on subcategory page, it only shows subcategory name in page title.

Shouldn’t Page title be like?
Parent Category → SubCategory → so on?

Problem Example:
This page is missing the parent category name ‘USA’ in page title

This results in same page title for multiple subcategories (with same name) inside different parent categories and SEO is affected.

Example: if i have ‘News’ subcategory under parent categories like USA->News and Australia->News.
Both subcategory pages will have the same Page title even though they belong to two different parent categories.

Please help with a setting, if any, that i may have missed.

3 Likes

Oh you mean the literal subcategory page <title>.

Sure I can see that, but I expect it will be a bit of a micro-optimization… on the other hand, it is pretty trivial to “fix”, so why not? Can you take that @gerhard?

3 Likes

Thanks @codinghorror for replying.

Yes, I mean the attribute on the page should include the Parent categories as well.

Looking forward for the fix.

That should fix it:

https://github.com/discourse/discourse/pull/7576

With the following hierarchy: PARENT CAT → SUB CAT

The title anchor will now print: “Latest PARENT CAT/SUB CAT topics - SITE TITLE” when browsing subcat page.

2 Likes

Thanks. i appreciate it. I guess the fix will be part of next release?

If you are self hosted and on Tests-passed (the default) you can upgrade now, either from the command line or at /admin/upgrade.

1 Like

AFAIK that PR hasn’t been merged yet.

1 Like

This is now merged :tada:

4 Likes

This topic was automatically closed after 24 hours. New replies are no longer allowed.