SEO and AI search
Web
AI
Resources
WorkAboutStart a project

Technical SEO

SEO for HTML: the tags that matter and the ones that do not

Search engines read your HTML before anything else. A handful of elements carry most of the weight, and a lot of old advice about tags no longer applies.

In short

For SEO, your HTML needs a unique title element, one clear h1, a logical heading outline, descriptive links and image alt text, a canonical link, a viewport tag, and structured data in JSON-LD. Put the main content in the HTML the server sends, use real anchor tags for links, and ignore the meta keywords tag, which Google does not use.

What each element does for search

ElementRole in SEORule of thumb
titleOften used as the clickable headline in results, and a strong relevance signalUnique per page, front-load the topic, roughly 50 to 60 characters so it is not cut off
meta descriptionNot a ranking signal. Can be used as the snippet textOne honest sentence, about 120 to 158 characters
h1 to h6Show the structure of the page to users and crawlersOne h1 that matches the title's topic, then h2 for sections and h3 inside them
a hrefHow crawlers find and weigh pagesUse real anchor tags with a URL. Link text should describe the target
img altDescribes an image to screen readers and search enginesSay what the image shows. Leave empty for pure decoration
link rel canonicalTells Google which URL is the main versionPoint to the clean, preferred URL. Self-reference on normal pages
meta robotsControls indexing and snippetsUse noindex deliberately, never by default
meta viewportRequired for good mobile displayWidth equals device width
link rel alternate hreflangMaps language and region versionsInclude a self reference and return links
script type application/ld+jsonCarries structured dataMatch what is visible on the page

A skeleton you can copy

Here is the order of a clean page head and body, described in words so you can map it to your template.

  1. Document languageSet the lang attribute on the html element to the page language, for example en-US or en-GB. It helps screen readers and language detection.
  2. Head essentialsCharacter set, viewport, a unique title, a meta description, and the canonical link. Add open graph tags if you want good link previews on social platforms.
  3. Structured dataA JSON-LD script in the head or body describing the organization, article, product or local business that the page is actually about.
  4. LandmarksUse header, nav, main, article, aside and footer instead of a pile of generic div elements. They give crawlers and assistive technology a map.
  5. One h1 inside mainThen h2 sections in order, with h3 under them. Do not skip levels for styling. Use CSS for size.
  6. Links and images with meaningDescriptive anchor text and alt text, width and height attributes on images to prevent layout shift.

Where HTML and JavaScript collide

Google can run JavaScript, but it does so in a second step that can take longer. If your important text, links or product details only appear after scripts run, indexing can be delayed or incomplete. Check this directly: open the page source (not the inspector), search for a sentence from the main content, and if it is missing from the source, the server is not sending it.

  • Prefer server-side rendering or static generation for pages you want ranked. Frameworks such as Next.js support both. See our guide on Next.js SEO.
  • Navigation links should be anchor tags with an href. Click handlers on buttons or divs do not give crawlers a URL to follow.
  • Do not hide the main content behind a tab that loads only on click if you want it to rank.
  • Use the URL Inspection tool in Search Console to see the rendered HTML that Google actually stored.

Old advice to drop

MythReality
Fill in meta keywordsGoogle has said it does not use the meta keywords tag. Skip it.
Only one h1 allowed or you are penalizedHTML allows more than one, and Google handles it. A single clear h1 is still the simplest outline.
Bold keywords for a boostFormatting is for readers. It is not a ranking trick.
Put the title in all capitalsIt reads badly and gains nothing.
Comments in the code helpCrawlers ignore them. They only add weight to the page.

A quick test list

  • View source and confirm the title, description, canonical and h1 are present without running scripts.
  • Run the page through an HTML validator and fix unclosed elements, which can swallow content.
  • Use Google's Rich Results Test or the Schema Markup Validator on pages with structured data.
  • Check the mobile rendering in URL Inspection.
  • Search your site for pages with duplicate titles and empty h1 elements.

A crawl of the whole site catches these in minutes. Our technical SEO work starts there, and the technical SEO checklist and schema markup checklist list every item. Ask for a fixed quote after a short call on the contact page.

Pitfalls

  • Templates that copy the same title onto hundreds of pages.
  • A noindex tag copied from staging to production.
  • Canonical tags pointing to a redirected or blocked URL.
  • Using headings for style, such as an h4 above an h2, which breaks the outline.
  • Alt text stuffed with keywords. Describe the image as you would to a person who cannot see it.

Updated 30 October 2026

Questions, answered

Does HTML structure affect Google rankings?
Clean HTML helps Google understand a page, but valid markup alone does not raise rankings. The title, headings, links and main content carry the most weight.
How many h1 tags should a page have?
Use one. HTML5 allows more and Google copes with them, but a single h1 that states the topic keeps the outline clear.
Is the meta description a ranking factor?
No. Google may use it as the snippet text if it matches the search, so write it to earn the click.
Can Google read JavaScript content?
Yes, but indexing can lag and failures happen. Send critical content in the initial HTML to avoid relying on it.
What is the most common HTML SEO mistake?
Leaving a noindex tag or a wrong canonical in place after a launch. It silently removes pages from search, so check these first after any release.

Need your markup reviewed?

Send us the site and you get a fixed quote after a short call.