How to Add SEO Keywords in HTML: A Practical Guide

by .

To add SEO keywords in HTML, give the page a descriptive title, explain its subject in the main heading and opening paragraph, and use relevant wording in the rest of the content.

Add an accurate meta description, link text, and image alternatives.

Leave out the meta keywords tag: Google ignores it.

Let’s say you're creating a bicycle puncture tutorial.

The person trying to repair a bike tire would like to know what tools are necessary for fixing the puncture (e.g., patches), what process is required for repairing the puncture (i.e., finding the hole, applying the patch) and how they know their patch was successful.

Writing "bicycle puncture repair" over and over again is not going to provide them with anything to locate the puncture.

Your choice of using either the examples given here, in a plain HTML file, with a site generator, or through WordPress is up to you.

SEO keywords in HTML illustrated with a magnifying glass over a code window
Useful HTML content and descriptive metadata help explain a page. AI-generated illustration.

Where should SEO keywords go?

Start with the end goal that your visitor wants to achieve.

Select one major area and choose the words that you want to use to define it.

Location What to put there What to avoid
Title element A specific description of this page Repeated variations of the same phrase
H1 heading The main subject or task A vague heading such as “Welcome”
Opening paragraph A direct answer and useful context A long introduction that delays the answer
H2 and H3 headings The questions and steps being covered The exact keyword in every heading
Meta description An accurate reason to visit the page A comma-separated keyword list
Links Words that describe the destination Repetitive or misleading anchors
Image alt text The image's purpose in this context Keywords unrelated to the picture

There is no need to force the phrase into every field.

Decorative images usually have empty alt attributes.

The head contains the page title and meta description. The body contains the H1, useful paragraphs, section headings, descriptive links and contextual image alternatives.
Keep metadata in the head and the useful explanation in the body.

How to add SEO keywords in HTML, step by step

1. Choose the topic before editing tags

Identify what this page will allow visitors to accomplish: “allow a beginner to fix their own bike tire at home”.

“bike puncture repair” could be your main word.

Other related words could include: “patch inner tube”, “find leak” and “check tyre”.

Only place the terms in areas of the instructions where they’re relevant.

There’s no valid reason to stick them into every paragraph.

Be consistent with examples, headlines and promised outcomes.

A repair tutorial that starts off talking about selling new bicycles has lost sight of its original objective.

2. Write a descriptive title

Place the title element in the document head.

Instead of listing your company slogan repeatedly throughout your entire site, assign a unique title to each page.

<title>Bicycle Puncture Repair: Step-by-Step Guide</title>

Titles inform visitors of what they’ll receive upon opening the page prior to viewing it.

Engines can utilize it when generating result titles; however, the text shown may differ based on device size and selected result title.

Roughly 50–60 characters often keeps a title manageable.

That is not an HTML limitation or an assurance that all of the characters will be used within an engine’s result title.

3. Add a useful meta description

The description also belongs in the document head:

<meta name="description"
      content="Learn bicycle puncture repair at home: find a leak,
               patch the inner tube and check the repair before riding.">

Write it as a brief invitation with a clear outcome.

A practical starting point for descriptions is approximately 140–160 characters.

The amount shown in search results varies with the available display space.

Engines may instead utilize text taken from the page.

It does not replace article content; nor does it guarantee improved rankings.

Explain why this page relates to visitor needs.

For a generated site, these values are typically entered into the template or component responsible for the document head. Astro’s documentation for providing standard HTML metadata within a reusable component provides guidance on doing so.

4. Make the H1 and opening answer clear

The H1 is visible upon viewing the page; the title element is part of the document head.

Although they may share similar language, they don’t need to be identical.

<h1>How to repair a bicycle puncture</h1>
<p>Find the leak, patch the inner tube and check
   that it holds air before you refit the wheel.</p>

For this tutorial, use one clear H1.

Provide major steps as H2 headings; minor steps as H3 headings.

Determine the level of each heading based upon its placement within the document; then apply your CSS styles accordingly.

Scanning visitors should be able to locate “locate the leak” or “apply patch” without reading the entire page.

More helpful than five instances of “tips for bicycle puncture repair” would be those headings.

5. Use the body to solve the problem

List the tools, explain the method and discuss typical errors.

How can someone tell that their patch held? Explain the check; those details make a repair page useful.

Do not attempt to achieve a specific keyword density.

Read the page aloud. If the keyword distracts you from the sentence, rewrite it.

Remove hidden lists, irrelevant locations and duplicate footer text. Bing’s webmaster guidelines advise creating a logical HTML structure and warn against keyword stuffing.

The same document explains that search fundamentals support eligibility in Bing’s AI experiences; neither rankings nor citations are guaranteed.

Use an ordinary anchor with an href attribute.

Its wording should help visitors understand the destination:

<a href="/repair-tools/">Tools for puncture repair</a>

For images, describe what matters in context: “Hand applying a patch to a bicycle inner tube” is useful because that is what the photograph shows; “cheap bicycle puncture repair best” is not. Deque’s alternative text guide discusses why the image’s function matters when designating alternative text; informative images require useful alternative text; decorative ones should use an explicit empty alt attribute.

<img src="applying-inner-tube-patch.webp"
     alt="Hand pressing a patch onto a bicycle inner tube"
     width="800" height="500">

<!-- For an image used only as decoration: -->
<img src="decorative-divider.svg" alt="" width="800" height="20">

Specify width and height values to reserve space for images.

Specifying these values does not make image keywords more important.

For layout, see our guide to centering an image in HTML.

How to add SEO keywords in HTML: complete example

The small HTML page below combines the pieces.

Save the file as index.html and open it in a browser. It works independently of external files.

Snippets provided above use sample paths for link and image; change them to real paths on your site.

<!doctype html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1">
  <title>Bicycle Puncture Repair: Step-by-Step Guide</title>
  <meta name="description"
        content="Learn bicycle puncture repair: locate the leak,
                 patch the tube and check that it holds air.">
</head>
<body>
  <main>
    <h1>How to repair a bicycle puncture</h1>
    <p>Locate the leak, prepare the tube and apply a patch
       following the repair kit instructions.</p>
    <h2>Find the leak</h2>
    <p>Inflate the tube slightly and look for escaping air.</p>
    <h2>Patch the inner tube</h2>
    <p>Follow the patch kit instructions for surface preparation
       and the required setting time.</p>
    <p>Before refitting the tube, <a href="#check-repair">check the repair</a>.</p>
    <h2 id="check-repair">Check the repair</h2>
    <p>Confirm the tube holds air and inspect the tyre for
       the object that caused the puncture.</p>
  </main>
</body>
</html>

Notice what is missing: there is no hidden list; there is no block of keywords repeated over and over again; the heading tells the reader what task they must perform; the following paragraph begins performing the task.

If you style the page, put the stylesheet connection in the head.

Our guide to linking CSS to HTML covers file paths and common loading issues.

Why the meta keywords tag will not help Google

You have probably come across guidance on including this tag:

<!-- This tag does not improve Google indexing or rankings. -->
<meta name="keywords"
      content="bicycle puncture repair, inner tube, bike patch">

The syntax may exist in an HTML document but Google doesn’t use this tag for ranking or indexing purposes.

Adding additional terms will not cause Google to act any different than prior behavior. The focus keyphrase in an SEO plugin assesses a draft. It does not send a special keyword instruction to Google.

How to add SEO keywords in HTML with WordPress

In WordPress, you usually edit fields that generate the HTML rather than entering document head data yourself.

  1. Set the post title and confirm that the theme displays it as the H1.
  2. Write an opening answer and useful subheadings.
  3. Enter a descriptive SEO title and meta description in the SEO plugin.
  4. Set the focus keyphrase so the plugin can assess the draft.
  5. Add accurate image alt text in the image settings.
  6. Preview the page and inspect the HTML it outputs.

Do not paste a full HTML document into a Custom HTML block. The theme already supplies the document head and body; inserting another set inside the article can produce invalid markup.

Check if duplicate metadata exists between theme fields and those controlled by an SEO plugin — correct source of duplication instead of entering third copy.

How to check that your changes worked

Check the published page first, then search performance.

They answer different questions.

Open the published URL and find the title and description using View Page Source. Use browser developer tools to inspect the headings, links and image alt attributes. For a site driven by JavaScript, compare the initial source with the rendered document. Run this read-only script in the developer console to get the current values:

({
  title: document.title,
  descriptions: Array.from(document.querySelectorAll(
    'meta[name="description"]'
  ), element => element.content),
  h1s: Array.from(document.querySelectorAll("h1"),
    element => element.textContent.trim()),
  imageAlt: Array.from(document.images,
    image => image.getAttribute("alt"))
})

This checks the current browser document. It does not tell you what Google indexed or whether the page will rank.

For an owned, verified website, use Search Console’s URL Inspection tool to investigate indexing and the fetched page. Its Performance report shows queries that generate impressions and clicks. Changes may need to be crawled and processed before search results reflect them.

Check metadata and visible content in the live source and browser DOM, then use URL Inspection and Search Console performance reports. Correct page output does not guarantee rankings.
Verify the page output first, then examine indexing and search performance.

Common problems and what to check

Problem Likely explanation Useful next step
Old title still appears on the page Cached output or the wrong template Check the live source and clear the relevant cache
Search result title is different The engine generated another title Compare the title, H1 and actual page topic
Description appears twice Two systems generate the same metadata Keep one responsible source
Page cannot be indexed Access, robots or indexing restrictions Inspect the URL and relevant directives
Keywords appear only after a click Important text is hard to access Put the essential explanation in ordinary page content
Nothing improved after adding keywords Wording alone did not solve the problem Review intent, content quality, discovery and technical access

Treat these as starting checks. A missing search listing can have several causes; adding more keyword repetitions will not fix a page that search engines and visitors cannot access.

Quick quiz: check your HTML SEO knowledge

Choose an answer before revealing the explanation.

Keep a count of your correct choices; there are four questions.

1. Which title is more useful for a repair tutorial?

A. “Home | Bicycle Website”
B. “Bicycle Puncture Repair: Step-by-Step Guide”

Reveal answer 1

B. It describes the task and gives readers a reason to open the page.

The article still needs to deliver those instructions.

2. Where should a page's meta description go?

A. In the document head
B. Inside the article's final paragraph

Reveal answer 2

A. Put the description metadata in the head, or use the CMS field that generates it there.

3. Will adding more terms to meta keywords improve Google rankings?

A. Yes, if the list is long enough
B. No

Reveal answer 3

B. Google ignores the meta keywords tag.

Spend the editing time on the actual page.

4. What belongs in the alt attribute of a purely decorative divider image?

A. The main keyword repeated three times
B. An empty value

Reveal answer 4

B. An empty alt value lets assistive technology skip decoration that adds no information.

Frequently asked questions

How many SEO keywords should one HTML page have?

Use one clear primary topic and the related terms needed to explain it.

There is no compulsory keyword count.

Separate pages make sense when they answer substantially different needs.

Should the exact keyword appear in every heading?

No.

Make headings describe their sections.

A relevant variation or a simple instruction often reads better than repeating the full phrase.

Before finishing, read the title, opening answer and section headings in order.

If they describe one useful page, you have a sound starting point.

Then check that the examples work and the deployed HTML contains the values you intended.

Join the discussion.

Some HTML is ok

You can use these tags:
<a href="" title="">
<abbr title="">
<b>
<blockquote cite="">
<cite>
<del datetime="">
<em>
<i>
<q cite="">
<strong>

You can also use <code>, and remember to use &lt; and &gt; for brackets.