Before we get into the nitty-gritty, let's clear up one of the most common points of confusion in all of web development. What's the difference between the h1 tag and the title tag?
- The <title> tag lives in the
<head>
of your document. It's a ghost. You don't see it on the page itself. Its job is to appear in the browser tab and, more importantly, as the big blue link in Google's search results. It's the SERP headline.
- The <h1> tag lives in the
. It's the first thing your visitor sees on the page. It's the page headline.
Think of it like a book. The <title>
is the title printed on the cover. The <h1> is the title printed again on the first page, just before the story begins.
The <title>
tag's job is to get the click. The <h1>'s job is to confirm that click was a good decision. They should be closely related, but they don't have to be identical twins. Sometimes the title that works best for the limited space of a search result isn't quite right for the page itself. That's fine! Just don't make them so different that users feel like you pulled a bait-and-switch.