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
| Element | Role in SEO | Rule of thumb |
|---|---|---|
| title | Often used as the clickable headline in results, and a strong relevance signal | Unique per page, front-load the topic, roughly 50 to 60 characters so it is not cut off |
| meta description | Not a ranking signal. Can be used as the snippet text | One honest sentence, about 120 to 158 characters |
| h1 to h6 | Show the structure of the page to users and crawlers | One h1 that matches the title's topic, then h2 for sections and h3 inside them |
| a href | How crawlers find and weigh pages | Use real anchor tags with a URL. Link text should describe the target |
| img alt | Describes an image to screen readers and search engines | Say what the image shows. Leave empty for pure decoration |
| link rel canonical | Tells Google which URL is the main version | Point to the clean, preferred URL. Self-reference on normal pages |
| meta robots | Controls indexing and snippets | Use noindex deliberately, never by default |
| meta viewport | Required for good mobile display | Width equals device width |
| link rel alternate hreflang | Maps language and region versions | Include a self reference and return links |
| script type application/ld+json | Carries structured data | Match 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.
- 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.
- 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.
- Structured dataA JSON-LD script in the head or body describing the organization, article, product or local business that the page is actually about.
- LandmarksUse header, nav, main, article, aside and footer instead of a pile of generic div elements. They give crawlers and assistive technology a map.
- One h1 inside mainThen h2 sections in order, with h3 under them. Do not skip levels for styling. Use CSS for size.
- 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
| Myth | Reality |
|---|---|
| Fill in meta keywords | Google has said it does not use the meta keywords tag. Skip it. |
| Only one h1 allowed or you are penalized | HTML allows more than one, and Google handles it. A single clear h1 is still the simplest outline. |
| Bold keywords for a boost | Formatting is for readers. It is not a ranking trick. |
| Put the title in all capitals | It reads badly and gains nothing. |
| Comments in the code help | Crawlers 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?
How many h1 tags should a page have?
Is the meta description a ranking factor?
Can Google read JavaScript content?
What is the most common HTML SEO mistake?
Keep exploring
Technical SEO services for sites that will not index
If good pages are missing from Google, or rankings fell after a rebuild, the cause is usually technical. We find it in your Search Console and fix it…
ChecklistTechnical SEO checklist
Most technical SEO lists treat every item as equal. This one sorts checks into four levels, from problems that remove pages from Google to polish…
ChecklistSchema markup checklist
Structured data is easy to add and easy to get wrong. This list matches schema types to page types, flags what Google no longer rewards and ends with…
Need your markup reviewed?
Send us the site and you get a fixed quote after a short call.