Add H1 titles for Discourse pages (SEO)

AI-generated summary

The discussion revolves around adding <H1> titles to Discourse pages for SEO purposes. askmanny suggests implementing <H1> tags for topic titles and category names, citing an SEO expert’s recommendation. sam notes that topic pages already have an <H1> tag, but askmanny corrects this, stating that only an <H2> tag is present. sam later clarifies that the <H1> tag is only visible when JavaScript is disabled or for crawlers. codinghorror suggests that the SEO expert’s recommendation is unnecessary, but riking points out that the change is relevant for no-js and crawler views. Ultimately, sam agrees to change the <H2> tag to <H1>, and neil implements the change, also fixing links that crawlers see. askmanny expresses enthusiasm for the change, expecting a sizable SEO impact.

Hey there!
We’ve been working with the amazing support of the Discourse team on the migration of our two communities (TuDiabetes.org and EsTuDiabetes.org) from Ning to Discourse. [TuDiabetes.org][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:

Thoughts?
[1]: http://TuDiabetes.org

5 إعجابات

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

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

إعجاب واحد (1)

Sam,
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:

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

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:

إعجابَين (2)

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

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

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

Which is common in no-js and crawler view.

إعجابَين (2)

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

إعجابَين (2)

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

إعجابَين (2)

I just made this change.

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

7 إعجابات