# 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.

- Page: https://liftup.tech/guides/seo-for-html/
- Type: Guide
- Updated: 2026-11-20

## 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.

1. **Document language**: Set 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 essentials**: Character 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 data**: A JSON-LD script in the head or body describing the organization, article, product or local business that the page is actually about.
4. **Landmarks**: Use 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 main**: Then h2 sections in order, with h3 under them. Do not skip levels for styling. Use CSS for size.
6. **Links and images with meaning**: Descriptive anchor text and alt text, width and height attributes on images to prevent layout shift.

For the next step, see [how long a meta description takes to update](https://liftup.tech/guides/how-long-does-it-take-for-seo-description-to-update/).

## 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](https://liftup.tech/guides/seo-for-nextjs/).
- 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.

We cover this in more depth in [GitHub Pages SEO basics](https://liftup.tech/guides/how-to-improve-seo-results-for-a-github-pages-website/).

## 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](https://liftup.tech/services/technical-seo/) work starts there, and the [technical SEO checklist](https://liftup.tech/checklists/technical-seo-checklist/) and [schema markup checklist](https://liftup.tech/checklists/schema-markup-checklist/) list every item. Ask for a fixed quote after a short call on the [contact page](https://liftup.tech/contact/).

## 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.

## 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.

## Related

- [Technical SEO services for sites that will not index](https://liftup.tech/services/technical-seo/)
- [Technical SEO checklist](https://liftup.tech/checklists/technical-seo-checklist/)
- [Schema markup checklist](https://liftup.tech/checklists/schema-markup-checklist/)

---

Get a fixed quote: https://liftup.tech/contact/ · email rohit@liftup.tech · WhatsApp +91 77689 10234 (https://wa.me/917768910234) · reply within one working day.
Source page: https://liftup.tech/guides/seo-for-html/ (Liftup Technologies)
