Proposal: changing the titles of HTML element reference pages

(Eric Shepherd) #1

Currently, HTML element reference pages have simply the element name as the title, like <tr> or <body>. This is succinct but is not great for SEO. I would like to propose we change these titles (not the page slugs, just the titles) to:

<element>: The HTML element’s full name element

So the <tr> page would have the title:

<tr>: The HTML Table Row element

And <figcaption> would be:

<figcaption> The HTML Figure Caption element

This would improve indexing of the pages, and would provide a much more descriptive title when users see these pages in a listing on Google or whatever. Does anyone have any objections or suggestions to change those before I make this happen?

On a related note, I’d like to also figure out a reasonable way to sneak the word “tag” into the HTML Reference pages. We don’t use that term on MDN; we typically use the word “element” instead, to describe the entire element rather than simply the tag itself. But “tag” is a common part of search queries, so we need to try to find ways to adapt to using it at least a little bit.

I suppose we could at least start trying to make an effort to single out the tag itself from the element as a whole in each document, but I worry that this is amounts to unnecessary bloat to the material. Any ideas how we can do this cleanly?


(Jwhitlock) #2

There are two titles, and the change needs to be considered for both. Which are you proposing to change, and what would both look like after your change?

The <title> in the <head> section includes the name of the topic. For tr, it is <title>&lt;tr&gt; - HTML | MDN</title>.

The “title” in the <body> section is an <h1>. For tr, it is <h1><wbr>&lt;tr&gt;</h1>.

(Eric Shepherd) #3

That’s a good point, John. We actually need to change the <title> too, since that’s where the SEO kick comes from. I was only thinking of the <h1>, which isn’t enough at all.

What I want to do is something like this:

  • Change the <h1> to what I suggested above, such as <h1>&lt;tr&gt;: The HTML Table Row element</h1>.
  • Change the <title> to something like <title>&lt;tr&gt;: The Table Row element - HTML</title>.

For the latter, we could use the same title as the original except we already have code logic in place to tack the " - HTML" at the end, so that would take more code work to do.

Of course, the trick here is that we don’t have a way to independently control the <title> and <h1> at this time; it’s on the list of things we will need to get implemented for SEO support but I doubt any movement will happen there until next year.

What we could do for the time being is just change the title (as configured in the page editor’s “Edit Page Title and Properties” area) to what we want the <h1> to be, and accept the slight oddness in the generated <title> for now until we’re able to address it. The word “HTML” will be there twice but I suspect we can live with that for now.

Eventually we will need to be able to configure the <title>, <h1>, and SEO summary individually and externally from the page content (currently the SEO summary can only be set by wrapping part of the article text in a special class, for those who don’t know). But that’s a whole other kettle of fish.


(Eric Shepherd) #4

I think as an interim solution (which is viable because there’s a relatively limited number of HTML elements), I’d like to rename each element’s main page to:

<elementname>: The Element Name element

It’s important to note that the pages’ URLs will not change because of this.

So <tr> would be:

<tr>: The Table Row element

That’s how it would be displayed in the <h1> block on the page. In the <title> element, it would be:

<tr>: The Table Row Element - HTML | MDN

That’s a good middle ground for now; we get the improved title length and keyword usage we need without requiring any code adjustments at all.

Any objections to my doing that? Any "wow what a great idea I can’t believe it!"s? Let me know. :slight_smile:


(Kadir Topal) #5

Wow what a great idea I can’t believe it! :grinning:

But seriously, I think that’s a very sensible way of moving this forward

(Stephanie Hobson) #6

Do we have a style guide for page titles? I think they are supposed to be sentence case not title case.

<tr>: The table row element

Given the negative reactions we had from users when we enlarged the font of the page titles I would not be surprised if we get similar push back on this. That’s no a reason not to experiment with it though.


(Stephanie Hobson) #7

We’re also talking about adding the breadcrumbs back and this will look weird for that:

HTML › HTML element reference › <tr>: The table row element

Can we experiment with it on a few pages to see if it helps? The page structure project isn’t final yet so I’m not sure if the breadcrumbs will make a comeback or not but it would help if we had data to tell us how important a change it is.


(Eric Shepherd) #8

So, yes, we use sentence case for our page titles and headings on MDN. However, in this case, we’re kind of treating “Table Row” like a proper noun, thus “<tr>: The Table Row element”. This helps clarify to new readers, also, where that “tr” comes from.

Yeah, we will experiment with it before we deploy it on a grand scale, I think. But changing the <title> is a must-do, since it’s relevant for SEO purposes.

Now, one other thing on our list of things we need to do is to support separating the <h1> and <title> values from each other. Right now, the same text is always used for both (although the <title> automatically gets some extra stuff added).

If we implement that, then we could actually set the <title> to “<title>: The Table Row element” and the <h1> to “<tr>”, then use the h1 string in the breadcrumbs. Problem solved. That would get us the SEO-friendly <title> we need, a small on-page title, and would make the breadcrumbs look nice.


(Eric Shepherd) #9

For now, I’m going to slot in time to go ahead and start updating the titles of the HTML element pages to <_elementname_>: The _element's full name_ element.

We’ll change them again later, I expect, once we’re able to separate the <h1> and <title>, but this will be a good start for SEO for now.

If you disagree with this change, speak now or forever hold your peace. :slight_smile:

Eric Shepherd
Senior Technical Writer
MDN Web Docs: