Add H1 titles for Discourse pages (SEO)

Hey there!
We’ve been working with the amazing support of the Discourse team on the migration of our two communities ( and from Ning to Discourse. [][1] is already on Discourse, and we’re in the process of migrating EsTuDiabetes.

Since both communities are 8+ years old, we were fortunate to be able to get help on the SEO front from an SEO expert that has helped guide our steps to ensure that our previous SEO rankings are preserved as much as possible.

Currently there doesn’t seem to be any <H1> tags implemented on Discourse (at least not structurally). This is a missed opportunity, since this tag gets important weight by search engines. So he recommended the following:



Hmm, I am seeing a H1 on the topic page:

Nothing on category pages, agree we should probably add it there.

1 Like

Are you seeing the <h1> tag appear on THIS page?

When I search the source code, I cannot find it. I do see the <h2> tag assigned to the topic title:

  <a href="/t/add-h1-titles-for-discourse-pages-seo/28106">Add H1 titles for Discourse pages (SEO)</a>

It would be ideal to have <h1> be the one that has the title inside, since it's given more weight by search engines.

Ahh, I see this is only the case for js disabled / crawler.

Yes, there is a difference between view-source and inspect-element
I guess for SEO purposes (though IMHO a bit unnecessary) it should be in the no js mark-up

This is basically irrelevant, have the person who gave you this recommendation look at the page using the Google crawler user-agent, and they will understand why :wink:


Not really. They’re asking for a change to this line:

<!-- app/views/topics/show.html.erb -->

  <%= render_topic_title(@topic_view.topic) %>

Which is common in no-js and crawler view.


I am fine to change that to H1 it does not really matter that much.


Having this changed and also adding <H1> to the category name on category pages would have a sizable SEO impact, so YAY! :smile:


I just made this change.

Also related to TuDiabetes: the links that crawlers see were missing the subfolder (/forum), so I fixed those links.