12/02/2024 | News release | Distributed by Public on 12/02/2024 06:08
Updated: December 02, 2024
Published: November 20, 2024
If you think SEO is just about adding keywords to your pages, think again: HTML plays a big role in helping your pages rank. And thankfully, you don't need to be a developer to leverage the power of HTML tags.
I've made a living doing SEO blog writing for a decade, but even I have more to learn. For this article, I interviewed the one and only Cindy Krum, founder and CEO of mobile SEO consultancy MobileMoxie. I also tapped HubSpot's internal SEO experts, Killian Kelly and Victor Pan.
You won't want to miss these insights, including the nine HTML tags you should include in every web page if you want it to rank well in Google.
Table of Contents
HTML controls the content and structure of a website. HTML tags are pieces of code that are enclosed in angle brackets ("<" and ">"). Tags tell the web browser loading the HTML file (like Chrome, Firefox, and Safari) how to display content on a webpage.
For example,
is the HTML tag that creates a paragraph of text on the page. All of the paragraphs in this blog post are created with
tags. Another example is
, the HTML tag that tells the browser to display the line break HTML element.
Additionally, certain HTML tags tell search engines like Google what to crawl, what a web page is about, and how to index it. A line break tag is not one of these tags. However, the image tag is - it looks like this: . An image tag, as you might guess, adds an image to the page.
Specifically, the alt attribute is what's important here. We use it to add image alt text, which, in addition to helping users with visual impairments, helps Google understand what an image looks like. This makes the alt attribute crucial for SEO.
So, what does HTML have to do with search engine optimization? Well, as SEO expert Cindy Krum explains: "HTML is like the core understanding for Google of what the page is about."
For that reason, if you want Google to prioritize your web pages, it helps to speak its language: HTML.
Create and customize your own business website with an easy drag-and-drop website builder.
Before we discuss the nine HTML tags crucial for SEO, here are two important tips.
You probably use a WYSIWYG editor to add content to your website. Instead of typing "
" every time you want to create a heading, you probably just click the button in the editor that says "H2."If that's the case, then why learn HTML tags at all?
"WYSIWYG editors and WordPress plugins like Yoast handle much of the heavy lifting in SEO, but mastering HTML tags really puts you in the driver's seat," says Killian Kelly, SEO Content Strategist at HubSpot. "This becomes crucial when you're customizing content or troubleshooting."
For instance, if an SEO plugin isn't doing what you expected, you can go straight to the source (the HTML code) and fix it yourself. Or if a page isn't ranking well, or its title and H1 tags aren't showing up properly, you can, again, go to the HTML code to diagnose.
"As you progress and possibly try to implement more complex features, a thorough understanding of HTML gives you the flexibility to make those adjustments smoothly," Kelly adds.
In the early days of the World Wide Web, sneaky SEO tactics such as stuffing keywords into the hidden meta keywords tag were rampant. These "black hat" SEOs were trying to serve robots: the ones that Google uses to crawl and index pages.
But these days, Google has caught on. The search engine's algorithm and processes are sophisticated enough to catch any clever tactics people may devise to try to game the system. Don't try it.
When implementing any SEO tactic, whether that's writing a keyword-rich heading or deciding to deindex a page, it should ultimately be good for the humans visiting your website. So, for example, if a keyword feels forced or doesn't relate to what you're writing about, leave it out.
Now that you have a basic understanding of HTML, let's dive into the nine HTML tags you should use to improve your on-page SEO.
When you search on Google, the links in the SERPs are called "title links," and the title tag greatly influences them. The title tag looks like this in a page's source code:
In September 2021, Google said that, while it sometimes uses a different method, it still relies on the title tag 87% of the time when deciding how to display the title link.
"Why not use title elements 100% of the time?" writes Danny Sullivan, public liaison for Google Search. "Since 2012, we've used text beyond title elements in cases where our systems determine the title element might not describe a page as well as it could."
This tells us that our title tags must be descriptive and accurate if we want Google to use them.
To illustrate the point, let's analyze the title tag of a real-life web page. I typed "what is mlops" into Google. One of the results is from the AWS blog.
When I click the title link to dig deeper, I see that its title link, title tag, and H1 (another tag we'll discuss later) are all different.
The title tag, pictured below, reads, "What is MLOps? - Machine Learning Operations Explained - AWS"
The H1, pictured below, reads, "What is MLOps?"
And yet, Google has spun up its own title link based on both, which reads, "What is MLOps? - Machine Learning Operations Explained." Notice that it removed the "AWS," which Google has said it will do if other parts of the search results already show the brand name.
A meta description tag describes what a web page is about. It looks like this:
As a blogger, I've always heard that the most important thing about the meta description is that it must include the primary keyword. But Krum helped me realize it's more nuanced than that.
"The keywords included in the description don't matter so much," she explains. "It's more about telling the person what they should expect when they land on the page so that they don't hit the back button because we know engagement on a page is important to Google."
The meta description you set doesn't always become the "snippet," which is the short description you see in the SERP below.
Instead, Google writes, "Snippets are primarily created from the page content itself. However, Google sometimes uses the meta description HTML element if it might give users a more accurate description of the page than content taken directly from the page."
Create and customize your own business website with an easy drag-and-drop website builder.
While it's good to have a meta description with your keyword in it - it's not necessarily for Google's sake. The search engine reads the rest of your web page to see what it's about. The meta description really exists for the human visitors to your site.
"We don't want them to do what's called 'pogo sticking,'" says Krum, "which is to click through, realize they got to a page that they didn't expect or didn't want, and then leave. So I always tell people, 'You can't promise cute puppies unless you're going to deliver cute puppies.'"
If a person reads "cute puppies" in your meta description, clicks through, and does not find cute puppies on your web page, they'll bounce, which affects SEO.
Or worse - if your meta description fails to mention the cute puppies that are on your web page, and the searcher is looking for cute puppies, they won't click through at all.
"If you have bad clickthrough, you might be deprioritized eventually," says Krum.
So, when writing your meta description:
Headings provide structure and hierarchy to page content, from H1 (most important) through H6 (least important). Heading tags are denoted as
"Headings have a really long history in HTML," says Krum. "Before we had CSS, people organized and styled pages with headings."
Today, headings still play an important role in helping Google and your readers understand what a web page is about.
"From an SEO perspective, we focus mostly on one, two, three, and I sometimes go to four," says Krum.
Then, your H2 should be a topic that is below or related to the H1's topic. For example, one of the H2s in this blog post is "What are HTML tags?".
So, when should you make the title tag different from the H1? I asked HubSpot's SEO pro, Victor Pan.
"That's a loaded question," he replied.
Without getting into the nitty gritty, suffice it to say, it's complicated. In the end, Pan advised: "In most cases, there's no need for further optimizations." So you're probably fine keeping your H1 and title tag the same.
However, here are some cases in which Pan says you might want to change your title tag to be different from your H1:
Create and customize your own business website with an easy drag-and-drop website builder.
The tag includes the alt attribute, which is used for adding image alternative (alt) text. Alt text does three things:
That makes image alt tags important for SEO and accessibility.
The image alt tag looks like this in the page's source code:
src="flowers.jpg" alt="Flowers in a vase">
Google writes, "The most important attribute when it comes to providing more metadata for an image is the alt text." Did you see that? The most important. So don't leave the alt text blank when you have images on your page!
To be clear, image file names are not technically HTML tags. However, I didn't want to leave this piece out while we're on the topic of images, especially since image file names matter for SEO.
"That's all been kind of de-emphasized in the past couple of years, so maybe it matters less," clarifies Krum. "We don't see Google talking about it very much. So, it's not the first thing we would fix."
However, Krum still advises: "In the file naming, it's better, especially if it's a unique image, to have a keyword-optimized file name."
While alt text is still the most important aspect of image metadata, Google says, "The filename can give Google very light clues about the subject matter of the image."
In HTML, an anchor tag () creates hyperlinks. Hyperlinks are critical to SEO because they pass "link juice" - also known as SEO juice, link value, or link equity - to the page it links to.
It's kind of like getting referred to a job versus applying cold. A good backlink tells Google, "Hey, I know this web page is legit," helping the page appear more authoritative and, hopefully, rank higher in SERPs.
Internal linking, where you link to pages on your own site, matters for SEO too. Let's say you're writing a blog post about HTML and SEO. You might link to a related post on your blog, say, one about how to use internal links. In fact, that's exactly what I did at the beginning of this paragraph.
Google advises: "Every page you care about should have a link from at least one other page on your site."
It also adds: "The better your anchor text, the easier it is for people to navigate your site and for Google to understand what the page you're linking to is about."
Sponsored and nofollow "tags" are technically values for the "rel" attribute in the anchor tag (). You can see them in bold in the HTML code below: nofollow sponsored">HubSpot
"Nofollow" has been around much longer than "sponsored," but now, Google prefers the latter for paid links, stating: "The nofollow attribute was previously recommended for these types of links and is still an acceptable way to flag them, though sponsored is preferred."
Use "sponsored" or "nofollow" anytime you:
Remember, Google prefers the "sponsored" attribute for affiliate links, but in reality, it allows you to use "nofollow" alone - or both.
Personally, I prefer to use both "sponsored" and "nofollow" for affiliate links on my websites and haven't noticed any negative SEO effects.
But if you're curious, here are some big brands I analyzed and how they use these attributes:
Good Housekeeping marks its affiliate links with "nofollow" only.
Wirecutter marks its affiliate links with "sponsored" only.
And Travel + Leisure uses both:
Use a robots meta tag to control if and how your web page appears in search results. Now, you may be wondering, why would you not want your page to rank? Some examples include:
Create and customize your own business website with an easy drag-and-drop website builder.
In my 14+ years of blogging, I've never once thought about the robots meta tag, so I nearly left it off of this list.
"This one's really important, actually," says Krum, "because Google kind of changed their guidelines. It used to be that robots text files that are stored at the root … were the rule, and on-page meta robots were a suggestion. And they reversed that after mobile-first indexing. And now, they take on-page meta robots as the rule and robots text file as a suggestion."
In its documentation, Google explains, "The robots meta tag lets you use a granular, page-specific approach to controlling how an individual HTML page should be indexed and served to users in Google Search results."
Pro tip: Do not confuse the robots meta tag () with the robots.txt file - they are two different things.
Robots meta tag |
Robots.txt file |
Requires editing the section of an individual web page |
Requires root access to your server to edit the robots.txt file |
Has a page-specific effect |
Has a site-wide effect |
Is viewed by Google as the rule when it determines what to crawl and index |
Is viewed by Google as a suggestion when it determines what to crawl and index |
Fairly easy and less technical to implement |
More complex and technical to implement |
To wrap my brain around this new-to-me tag, I, once again, asked Pan.
"Search engines default to indexing pages and following links on the page," he explains. He gave me the following guidance on when and how to use the robots meta tag:
Pan says it's "a very common treatment for paid search landing pages you don't want suddenly ranking in organic search results."
By using the following HTML code, you're telling Google not to index your page nor follow any of the links on it.
Code snippet:
Pan adds, "In practice, when a page gets removed from subsequent visits by a search engine, this basically behaves like 'noindex, nofollow.'"
Code snippet:
"This is more rare out in the wild," says Pan, "but a treatment an affiliate website may do instead of inlinking specific links with 'nofollow' link attributes."
The "nofollow" value of a robots meta tag, then, differs from the "nofollow" tag we talked about earlier in this way: The robots meta tag "nofollow" tells Google not to follow any of the links on that web page. The "nofollow" tag, however," applies to an individual link.
Code snippet:
Before we ended our call, Krum emphasized the importance of the canonical tag, which tells Google which version of a page is the preferred one. But we didn't have time to delve into why. So I asked HubSpot's Killian Kelly for clarification.
"Canonical tags are essential for managing content that appears in multiple locations, especially when it's similar or duplicated," Kelly explains.
For example, when HubSpot does split testing (testing the performance of different variations of the same page), the duplicated page typically has the "rel="canonical" tag pointing to the original.
"This setup identifies the original page as the main one, guiding search engines on which page to prioritize," says Kelly.
But what if you don't do split testing and don't intend to have duplicate content? According to Pan, it's still good to use a canonical tag on every page. Failure to do so can have downsides, especially for websites with lots of pages.
As Pan explains: "The potential negative consequence for larger websites is that a parameterized variant of the URL or a scraper website which likes to copy your website's content may sometimes be chosen as the canonical version in search results without it."
Personally, I've never intentionally used a canonical tag. But when I looked back at my old WordPress blog posts, I discovered that the Yoast plugin had automatically set canonical URLs for me.
The biggest lesson I learned while researching canonical tags is this relatively new development: For syndicated content, use the robots meta tag "noindex" - not the canonical tag. While canonical tags have been widely used to prevent duplication when a publishing partner republished original content on their website, that's no longer a best practice.
In 2023, Google stopped recommending canonical tags for syndicated content. Instead, it advises publishers to block syndicated content using the robots meta tag (aren't you glad you learned about that HTML tag earlier?).
Blogging is a huge passion of mine as well as my career. When I first started learning how to write blog posts that ranked well in Google, learning SEO and HTML tags gave me a huge advantage over other bloggers who didn't want to bother with the more technical aspects.
I hope this article helps you realize that HTML is not some big, scary thing but rather a tool you can use to get more eyes on the content you work so hard on. There are other levers you can (and should) pull as well, such as improving website speed.
And remember, SEO is always changing. I thought I knew a lot about HTML tags, but while writing this article, I realized some of my SEO tactics were outdated.
To stay up to date, follow SEO experts like Cindy Krum on X (formerly Twitter), read blogs (the HubSpot Website blog is my shameless plug), and, of course, go straight to the source: Google Search documentation.
Create and customize your own business website with an easy drag-and-drop website builder.