How to Add Keywords to a Website for SEO (20 Spots in HTML)

Are you trying to figure out how to add keywords to a website for SEO?

When you’re writing content, do you often wonder, “Where do you put keywords in HTML?”

If so, this guide is for you.

The short answer is that there are 20 places you can put your keyword phrases on a website for maximum SEO value and rankings. And in this blog post, I’m going to show you where all of those secret spots are in the HTML document.

By the end of this page, you’ll know everything there is about on-page keyword optimization so you can do a better job at writing and ranking your content.

How to Add Keywords to a Website for SEO

Meta Title

The meta title is the most important place to add your keyword phrases in the HTML, and it’s the first step you need to take how to add keywords to a website for SEO.

A meta title acts as a name tag for a webpage and is what first appears in the search engine results page for a user to click on. Therefore, search engines like Google, Yahoo, and Bing put a lot of SEO value on this HTML meta field.

If you don’t have your keyword phrases in the meta title, then you likely won’t rank for that term. So always put your key phrase in this location.

To get the most value out of the meta title, it’s important to put your keywords at the beginning of this field; not towards the end. Position matters a lot here. The closer your keywords are to the beginning of the meta title, the more relevant it is seen by the search engines.

I always start my meta titles with my main target keyword to get the most SEO value out of it. I then try to fit additional keywords into this field where it sounds natural.

For example, I want this page to rank for these two keyword phrases:

  • how to add keywords to a website for SEO
  • how to add keywords to website HTML

And the best way to do that is to include as many of these phrases as possible in the meta title without repeating words.

Take a look at the image below to see how I did just that for the meta title for this page.

How to add keywords to website HTML meta title

If you use WordPress for your website, then can use an SEO plugin like All in One SEO, Yoast, or Rank Math to tweak the meta titles to improve search ranking potential.

Meta Description

The meta description is not a direct ranking factor for Google. However, it does show up as the second part of the search results entry for your webpage and adds relevance to the keywords people are searching for.

As you know as a search engine user, the meta description influences your decision on if you want to click on a search result or not. So it’s best to include your keyword in this location so the user will consider your listing to be more relevant to their search query.

Additionally, having a good marketing message or a brief snippet of what the webpage is about along with your target keyword can help influence the number of people who click on your search results entry. And that’s what really matters here.

Here’s a screenshot of how I included my target keyword phrase in the meta description:

How to add keywords for Google search meta description

Meta Keywords

The meta keywords tag is not used by the major search engines anymore, but many on-page SEO plugins still include it.

As Google states here, “keyword meta tags quickly became an area where someone could stuff often-irrelevant keywords without typical visitors ever seeing those keywords. Because the keywords meta tag was so often abused, many years ago Google began disregarding the keywords meta tag.”

Therefore, the meta keywords tag is completely ignored by Google, and many SEOs leave this field blank. However, some of the other search engines may pay a little bit of value on this HTML location, so you can choose to include your keyword here if you’d like.

I personally ignore the meta keywords field for my content but you can find out more about this HTML tag by visiting my post on what are meta keywords.


The best URLs are ones that give your visitors and the search engines a clue about what the website is about, the webpage content, and where a page is located in the organizational structure of the site.

And the URL is one of the top HTML locations for where keywords can go in a website for better SEO rankings.

Your website’s URL has several areas where you can include your keywords in any of them. However, the best SEO advice I can give you here is to include no more than one or two exact match keywords in the URL. You want to avoid keyword stuffing.

Here are the four components of a URL that you can put keywords:

  • Domain Name: Your website domain name can include your main target keyword like this: keywordphrase.com.
  • Subdomain Name: If you have subdomains set up on your website, then you can include keywords here like this: keyword-phrase.companyname.com.
  • Folder Name: If the content on your website is organized into folders, then the folder names can include your keywords like this: companyname.com/keyword-phrase/pagename
  • Page Name: The actual page name can include your keywords like this: companyname.com/foldername/keyword-phrase.

Header Tags

The header tags in an HTML document are used to organize the content structure. These tags also break up the blocks of text so it’s easier to skim and read.

Header tags consist of H1 to H6 elements. But for SEO purposes, only the H1 to H4 tags are what matter the most for on-page search engine optimization. The experts at Page Optimizer Pro verified the importance of keyword presence in these areas.

Here’s how use and add keywords properly in a website’s header tags:

  • H1: The H1 is considered to be the main header tag for the page. It should only appear once and be at the top of the content. You should always your main keyword phrase at the beginning of the H1 tag and include any additional keywords without stuffing. A good practice here is to just copy the SEO-optimized meta title to the H1 field. (Check out my SEO H1 best practices page for more details.)
  • H2-H4: You can include as many H2 to H4 tags as you want on the webpage. However, the best practice here is to use H2s to break up the main topics on the page and put H3s under the H2s (where necessary) as the sub-headers. A good SEO strategy is to include your keywords at least once in the H2 tag and use variations in the H3 tags. I personally don’t use H4s.

One other key thing to note here is that you can use header tags to win Google’s featured snippets and People Also Answer boxes. By structuring your content as I explained above with H2s and H3s, you can give Google exactly what it wants in order to feature your content into those locations on the search engine results pages.

Download the SEO Keyword Research CheatsheetDownload the SEO Keyword Research Cheatsheet

In the image below, you can see how Crazy Egg is using this same advice to rank in the featured snippet for the target keyword phrase, “how to optimize a webpage”. The main heading is an H2 while the 1 through 8 list items are H3s.

Featured snippet heading optimization

Body Content

The body content of a page is a top SEO ranking factor. That’s because, without properly optimized content, search engines can struggle to know what keywords you want a webpage to rank for.

Therefore, you’ll want to make things easy on search engines like Google by giving it what it likes in regards to keyword placement within the body content.

I talk about this briefly in my post on how can you improve your keyword search results, but I’ll go more in depth here.

There are three key areas in which you want to put your keyword phrases:

  • Introduction: Put your keywords within the first 100 words of the page.
  • Main Content: Put your keywords at least 2-4 times in the main content of the page (evenly spread out).
  • Summary: Put your keywords within the last 100 words of the page.

Now, keep in mind that you want your content to be readable. So don’t just stuff your keywords into these locations without it sounding natural. Write for humans first, and make content readable and understandable.

Also, you may think that this advice will result in too many uses of your keywords (or not enough) in the body content, but you can trust me on this. I’ve been using this exact formula for 15 years on every piece of content I write.

In fact, if you do a CTRL + F on your keyboard and look for my main keyword phrase, “how to add keywords to a website for SEO”, you’ll find it used five times in the body paragraph content as I explained above. However, I also made sure this article was at least a certain length as outlined in this other guide on the optimal SEO word count here.


Images are another good place to add your keywords to a website. And while this may seem strange because images are visual elements, graphics and pictures still have three locations you can optimize for keywords.

So where do keywords go in a website with images?

Here are the four key places for image keyword optimization:

  • ALT Tag: The ALT tag is an HTML element that describes an image to a screen reader. ALT tags help blind people understand what the visual elements are on a page. However, this is also a good place to put your keywords. Just make sure that the keywords relate to the image and are not just being stuffed into this field. Remember, the ALT tag is mainly used to aid people with disabilities.
  • Image Title: You can put your keywords in the image title attribute. Its purpose is to specify extra information about an element but can also be used for SEO purposes.
  • Filename: You can put your keywords to the image filenames for added SEO value. Just use dashes between the words like this: keyword-phrase.jpg.
  • Image Meta Information: If you use an image editing software like Photoshop, you can manipulate the meta information that’s attached to the image. Often, these meta details are used to credit the photographer or graphic artist as well as provide searchable information for photo archives and databases. If you want to use it for SEO purposes, then you can edit the image’s meta title, description, and keywords tags in the file itself. And once uploaded to your website, Google will find this information.

DIV Tags

The <div> tag is a piece of HTML code that defines a division or a section in an HTML document. It is also a container that’s used for HTML elements that are styled with CSS or manipulated with JavaScript.

The most common way to use a <div> tag is to add a CSS class or id attribute to it. However, it can also be used in a secret way for how to add keywords to website HTML.

For example, you add a <div> on the page that contains your target keyword by coding it in the following ways:

  • <div class = “keyword-phrase”>
  • <div id = “keyword-phrase”>

Now, you may be thinking, “This SEO strategy can’t possibly work,” but I assure you that it can. In fact, the powerful Cora SEO software that was created by Ted Kubaitis reveals correlations between the number of keywords used in the DIV tags and higher Google rankings.

Does that seem unbelievable?

Check out this popular site called “Addicting Games” which ranks in the top 3 on Google for the super-tough keyword “games”. Look at how this website is using this DIV strategy to optimize its website for that keyword.

Keyword DIV SEO

HTML Title Attribute

The title attribute specifies extra information about the HTML element that it’s attached to. It’s also the tooltip text that pops up when you hover your mouse over the element.

What’s nice about the title attribute is that it is part of the Global Attributes in HTML, and can be used on any HTML element.

But where do you put keywords in HTML like this?

Here are the most basic elements you can use:

  • Paragraphs: <p>
  • Headings: <h1> <h2> <h3> <h4> <h5> <h6>
  • Horizontal Ruler: <hr>
  • Anchor Tag: <a>
  • Unorder and Ordered Lists: <ul> <ol>
  • List Elements: <li>
  • Images: <img>
  • Dividers: <div>
  • Spans: <span>

To use the power of the title attribute for your keywords, all you have to do is add it to any existing HTML element. Just don’t go overboard by stuffing your keyword in every title attribute on the page.

Here are a few examples of this strategy from the HTML elements listed above:

  • <p title = “keyword-phrase”>Text block</p>
  • <a title= “keyword-phrase”>Anchor text link</a>
  • <ul><li title = “keyword-phrase”>List Name</li></ul>

Similar to my last tip on using keywords in the DIV tag, the website Addicting Games is also using this SEO strategy in the HTML. Just look at at the image below to see how it’s being used.

Keyword title attribute SEO

Link Anchor Text

The anchor text of a link is the visible, clickable text in an HTML hyperlink.

And any time you link from one page on your site to another, you’re creating a good opportunity for adding keywords that you want the target page to rank for.

Here’s an example of keyword-optimized link anchor text: how many keywords per page.

Notice how I’m using an exact match keyword phrase in the anchor text. That hyperlinked text is the keyword phrase I want the linked page to rank for. And if you were to read other blog posts on this site, you would see other instances of that link anchor text being used.

By focusing on internal linking anchor text that’s keyword-optimized, you can increase a page’s rankings in Google. That’s because the anchor text sends a direct signal to Google about what the page is about and should be ranked for.

(I cover this idea more in-depth in my article on internal vs external links.)

However, the golden rule here is this: never repeat your link anchor text more than 50% of the time. You want to vary your anchor text so it doesn’t send a red flag to Google and potentially get your website penalized.

The strategy I follow for success is to rotate through the target keywords I want a page to rank for, that way I’m never over-optimizing by using the same keyword too many times. I also add in additional works to the link anchor text so each instance is not an exact match phrase.

For example, if I wanted to rank a blog post for the keyword, “SEO keyword tips”, then I could use the following internal linking plan:

  • SEO keyword tips (3 internal links)
  • SEO keyword tips here (2 internal links)
  • my SEO keyword tips (1 internal link)
  • keyword tips on SEO (2 internal links)

As you can see, I’m optimizing the internal link anchors for the keyword phrase but adding enough variations so it’s not overoptimized with an exact match phrase.

Navigation Menu

Your navigation menu is another place to include your keywords on a website. And it’s an often unutilized piece of SEO real estate for improving your website’s rankings.

Using descriptive anchor text in your global navigation menu means that every page on your website has keyword-rich links pointing to those pages.

Plus, if a page gets a lot of internal links, then this can send a signal to Google that the page is an important piece of content on your site. More links equal higher SEO value.

Now, similar to my last tip, you don’t want to stuff your keywords into the navigation menu. The best method here is to use a partial match keyword phrase. That way you’re not overoptimizing for the keyword.

For example, if you have a website that has a page on the “best keyword tools” and you want to add a link to it in your main navigation menu for higher SEO value, then I would suggest you drop the word “best” and just make that anchor text, “keyword tools”.

Another example would be a page that you want to rank for the keyword, “digital marketing services in Texas”. In this instance, I would just make the navigation menu anchor text read, “digital marketing services”.

Checking Your Ranking Improvements

After you’ve put all of these tips into place, you can then start checking your keyword rankings in Google.

To learn how to do that process, visit my page on how to check keyword position in Google. It lays out an easy step-by-step plan that anyone can use for position checking.

How to Add Keywords to a Website for SEO Summary

I hope you enjoyed this detailed guide on how to add keywords to a website for SEO.

The goal here was to provide a comprehensive answer to the question, “Where do keywords go in a website?”

As you learned, there are 20 places to put your keywords in website HTML for Google search ranking improvements. And the more spots you can add your keyword phrases, the more SEO optimized your pages will be for those terms.

How to add keywords to a website for SEO