Add H1 titles for Discourse pages (SEO)


(Manny Hernandez) #1

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:

  • If the page is a Discussion Topic, make the <H1> tag correspond to the topic title. Example: for TuDiabetes Forum, H1 would become = “Taking the plunge with Afrezza”.
  • If the page is a Discussion Category, make the <H1> correspond to the Category name. Example: for TuDiabetes Forum, H1 would become = “Insulin”.


(Sam Saffron) #2

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

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

(Manny Hernandez) #3

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.

(Sam Saffron) #4

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

(Mittineague) #5

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

(Jeff Atwood) #6

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:

(Kane York) #7

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.

(Sam Saffron) #8

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

(Manny Hernandez) #9

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

(Neil Lalonde) #10

I just made this change.

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

(Sam Saffron) #11