What Are HTML Tags?
HTML tags are markup elements used in HTML (Hypertext Markup Language) to instruct the browser how to display text, images, and other types of content. While there are many HTML tags, in the context of SEO, search engines read and understand certain tags during the crawling and indexing phase.
HTML tags are important for SEO for a simple reason: they can affect your website's organic SEO performance. When they are misconfigured, they can negatively affect your SEO efforts, while when they are properly optimized, they can improve your ranking positions.
In this post, you will learn about the most critical HTML tags for SEO and how to use them correctly.
10 Essential HTML Tags For SEO And How To Use Them
- Title Tag (<title>)
- Meta Description (<meta name="description">)
- Robots Tag (<meta name="robots">)
- Canonical Tag (<link rel="canonical">)
- Header Tags (<H1>, <H2>)
- Image Tag (<img>)
- Alt Text Tag (<alt>)
- Hyperlink Tag (<a>)
- NoFollow Tag (rel="nofollow")
- Hreflang Tag (hreflang)
1. Title Tag (<title>)
A title tag is an HTML element that specifies a web page's title. It appears in the SERPs (Search Engine Results Pages) and in the browser's title bar or tab and is critical for SEO and user experience.
Here is an example of a title in a search snippet on Google.
And this is how it is defined in the HTML of the page.
HTML Title TagThe title tag has no parameters; whatever is included in the <title></title> is the value of the page title.
How To Optimize Title Tags For SEO
To optimize the title tag for SEO, ensure it is concise, descriptive, and includes relevant keywords. A good title tag should accurately reflect the page's content and entice users to click through from search engine results.
Here are the best practices to follow:
- Keep It Short: Aim for 50-60 characters to ensure your title displays fully in search results without being cut off.
- Use Primary Keywords: Place your target keyword towards the beginning of the title to emphasize its importance and grab users' attention.
- Reflect the Content: The title should accurately describe the page's content to avoid misleading users and search engines.
- Avoid Keyword Stuffing: Use your keywords naturally rather than stuffing them into the title, which can negatively impact readability and SEO.
For more best practices, read Difference Between Page Title And H1 Tag For SEO.
2. Meta Description (<meta name="description">)
A meta description tag is a short snippet of text that summarizes the content of a webpage.
This description appears under the webpage's title in search engine results. It gives users a quick overview of what they can expect from the page.
Search engines may show the meta description when it’s highly relevant to what the user is searching for; otherwise, they might pick text from the page and create a dynamic description.
Here is an example of a meta description in Google search results.
And how it looks in the HTML code.
How To Optimize Meta Description For SEO
Optimizing the meta description for SEO is key to improving the click-through rate (CTR) from search engine results. Here are actionable tips to enhance your meta description:
- Use Actionable Language: Start with verbs like "Discover," "Learn," or "Find out" to encourage users to take action. For example, "Discover the best ways to improve your home's energy efficiency."
- Include Target Keywords: Integrate relevant keywords naturally into your meta description. This helps signal to search engines what your page is about and makes your description relevant to user queries.
- Keep It Under 160 Characters: While search engines often truncate meta descriptions after about 160 characters, keeping your description short ensures it is displayed without cuts.
- Provide Value: Highlight the main benefit or value proposition of your content. Tell the user what they'll gain by clicking through to your page.
- Avoid Duplication: Ensure each page has a unique meta description. Duplicate descriptions can confuse search engines and negatively impact your SEO efforts.
3. Robots Tag (<meta name="robots">)
The robots tag is a special HTML element that provides search engines with specific instructions on crawling and indexing a particular page's content.
The robots tag can take several values, each serving a unique purpose.
- Index - allows the page to be indexed.
- Noindex - prevents it from being indexed.
- Follow - allows the page's links to be crawled
- Nofollow - prevents links from being crawled.
You can combine these values to create specific directives. Here are some valid examples:
<meta name="robots" content="index, follow"> - means index the page and follow any links. This is the default value for many CMS unless you make a specific change.
<meta name="robots" content="noindex, follow"> - means the page itself will not be indexed, but its links can be followed.
<meta name="robots" content="noindex, nofollow"> - means don't index the page and don't follow any links.
It is important to note that these values should be added to the <head> of a page. If you are using WordPress, you can easily control these with Yoast SEO.
How To Optimize Your Robots Tag For SEO
To optimize the robots tag for SEO, follow these best practices:
Index Important Pages: Ensure that crucial pages like your homepage, main category pages, and high-value content pages have the robots tag set to index, follow. This allows search engines to index these pages and follow the links within them, improving your content's discoverability.
Noindex Low-Value Pages: Use the noindex tag for pages that add little SEO value, such as thank you pages, login pages, and duplicate content pages.
Noindex Unhelpful Content: Use the noindex tag for pages that might be considered unhelpful by search engines to protect your website from Google algorithmic updates. The pages will still be visible to users within your website but will not harm your SEO efforts.
4. Canonical Tag (<link rel="canonical">)
The canonical tag is an HTML element that helps prevent duplicate content issues by specifying a webpage's "canonical" or preferred version.
This tag is particularly useful for multiple pages with similar or identical content. By using the canonical tag, you signal to search engines which version of the page you want to be indexed and ranked.
The syntax is straightforward: <link rel="canonical" href="https://www.example.com/preferred-page/">.
The canonical tag is specified in the <HEAD> of the page.
How To Optimize Canonical Tags For SEO
To optimize the canonical tag for SEO, follow these best practices:
- Add a Canonical Tag To All Pages: Ensure that every page on your website either has a self-referencing canonical tag (pointing to itself) or the appropriate page.
- Use Absolute URLs: Always specify the full URL in your canonical tags, including the protocol (HTTP or HTTPS) and the domain.
- One Canonical Tag Per Page: There must be only one canonical URL per page.
5. Header Tags (<H1>, <H2>)
Header tags, such as <H1> and <H2>, are HTML elements used to define headings and subheadings on a webpage.
Header tags range from <H1> to <H6>, with H1 being the most important and typically used for the main title and <H2> through <H6> used for subheadings.
How To Optimize Your Header Tags For SEO
To optimize header tags for SEO, follow these best practices:
Use One H1 Tag Per Page: Ensure each page has one <H1> tag that accurately describes the page's main topic. The H1 tag is not the same as the page title, but it can have the same or similar values.
If you have more than one, it's not a big SEO issue and probably won't damage your rankings.
Incorporate Keywords Naturally: Include primary and secondary keywords in your header tags, but avoid keyword stuffing. Ensure the text remains readable and relevant to the content.
Maintain Hierarchy: Follow a logical structure by using <H1> for the main heading, <H2> for important sections, and <H3> for subsections.
6. Image Tag (<img>)
The <img> tag is an HTML element used when adding an image to a webpage. This tag requires the src attribute, which specifies the path to the image, and the alt attribute, which provides alternative text for the image if it cannot be displayed.
For example, <img src="/image.jpg" alt="A descriptive text about the image">.
How To Optimize The Image Tag For SEO?
Follow these image SEO best practices:
Use Descriptive File Names: Before uploading your image files, name them with relevant, descriptive keywords. For example, instead of IMG_1234.jpg, use blue-running-shoes.jpg.
Optimize Alt Text: This is the most important element for image optimization (see below for best practices).
Compress Images: Large images can slow down your website. Use tools like Squoosh to compress images without losing quality, ensuring faster load times and better user experience.
Use Responsive Images: Implement the srcset attribute to provide different image sizes for different devices. This ensures images are displayed optimally across all screen sizes, improving load times and user experience.
7. Alt Text Tag (<alt>)
The image ALT text is used with the <img> element and explains to search engines and visually impaired users what the image is about.
The ALT text is shown if an image cannot be loaded, and when images are used as links, the ALT text acts as the anchor text.
When optimizing your ALT tag, consider these guidelines:
Be Descriptive and Specific: Write alt text that clearly and concisely describes the image's content (see examples below). Keep it brief, ideally under 125 characters.
Include Relevant Keywords Only If Applicable: Incorporate keywords naturally in the image ALT without forcing keywords into the text.
Here are a couple of examples to help you understand this better.
8. Hyperlink Tag (<a>)
The <a> tag, or anchor tag, is used to create hyperlinks in HTML. These links can point to other pages on your website, external websites, or specific sections within the same page.
The <a> tag requires the href attribute, which specifies the link's URL.
For example, <a href="https://www.example.com">Visit Example</a> creates a link to the specified URL with the anchor text "Visit Example."
Consider these best practices when using links in your content:
Use Descriptive Anchor Text: Ensure the anchor text is relevant to the linked content and includes keywords naturally. Instead of "click here," use "read our SEO guide" if linking to an SEO resource.
Link to Relevant Content: Ensure your links point to relevant and valuable content. This improves user experience and helps search engines understand the context and importance of the linked content.
Add Links When It Matters: Avoid excessive linking within a single page, as this can dilute the value of each link. Focus on including high-quality, relevant links that enhance the content.
Check for Broken Links: Regularly audit your site to find and fix broken links. Tools like Google Search Console and Screaming Frog can help identify these issues. Broken links can harm user experience and negatively impact SEO.
9. NoFollow Tag (rel="nofollow")
The nofollow tag is an HTML attribute that tells search engines not to follow a specific link.
This tag is essential to prevent a page from passing SEO value or 'link juice' to another page. It’s commonly used for links in comments, forums, or any user-generated content where you don't want to endorse the linked page.
It is added as part of the <a> tag with the rel attribute, like the example below.
To optimize nofollow tags for SEO, follow these tips:
Apply the nofollow tag to links in user-generated content like blog comments, forums, and guest posts to avoid associating your site with potentially low-quality or spammy sites.
Always use the nofollow tag on affiliate links and sponsored content to comply with Google’s guidelines and avoid penalties.
Avoid using nofollow tags on internal links. Internal links should help distribute link equity throughout your site, improving the overall SEO.
10. Hreflang Tag (hreflang)
The hreflang tag is a special HTML tag used for multilingual websites, i.e., websites with content in multiple languages.
It helps search engines show users the correct language version of your content based on their browser language and location.
If your website is only in one language, you do not need to use the hreflang tag in your code.
Here's an example of how hreflang can be used for a website that has both English (US) and Spanish (Spain) versions of a page:
<head>
<link rel="alternate" href="https://www.example.com/" hreflang="en-us" />
<link rel="alternate" href="https://www.example.com/es/" hreflang="es-es" />
</head>
Notice that the code is part of a webpage's head section.
The first <link rel="alternate"> tag specifies that the English (US) version of the page is located at https://www.example.com/ and is identified with hreflang="en-us".
The second <link rel="alternate"> tag specifies that the Spanish (Spain) version of the page is located at https://www.example.com/es/ and is identified with hreflang="es-es".
Configuring your website for international SEO is a complicated task, and it should be implemented correctly. Read Google's guidelines for detailed instructions and best practices.
Learn More About SEO
To learn more practical tips on improving your SEO, consider enrolling in The Complete SEO Course. Our course is suitable for beginners and includes actionable advice on configuring all aspects of your website for maximum visibility in search engines.