How to Add Meta Keywords in HTML: Simple Guide
To add meta keywords in HTML, use the
<meta> tag inside the <head> section with name="keywords" and a content attribute listing your keywords separated by commas. For example: <meta name="keywords" content="html, meta tags, seo">.Syntax
The meta keywords tag uses the <meta> element with two main attributes:
- name="keywords": Specifies that this meta tag is for keywords.
- content="...": Lists the keywords separated by commas.
This tag goes inside the <head> section of your HTML document.
html
<meta name="keywords" content="keyword1, keyword2, keyword3">
Example
This example shows a simple HTML page with meta keywords added in the head. The keywords describe the page content for search engines.
html
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="keywords" content="html, meta tags, seo, web development"> <title>Meta Keywords Example</title> </head> <body> <h1>Welcome to My Web Page</h1> <p>This page includes meta keywords in the head section.</p> </body> </html>
Output
A simple webpage with a heading 'Welcome to My Web Page' and a paragraph below it.
Common Pitfalls
Many beginners make these mistakes when adding meta keywords:
- Placing the meta tag outside the
<head>section, which makes it ineffective. - Using too many or irrelevant keywords, which can hurt SEO.
- Forgetting to separate keywords with commas.
- Relying solely on meta keywords for SEO, as many search engines ignore them now.
html
<!-- Wrong: meta tag outside head --> <body> <meta name="keywords" content="html, css"> </body> <!-- Correct: meta tag inside head --> <head> <meta name="keywords" content="html, css"> </head>
Quick Reference
| Attribute | Description | Example |
|---|---|---|
| name | Specifies the meta tag type | keywords |
| content | Comma-separated list of keywords | html, css, javascript |
| placement | Must be inside | Yes |
Key Takeaways
Add meta keywords inside the using .
Separate keywords with commas and keep them relevant to your page.
Meta keywords have limited SEO impact but can still describe page content.
Never place meta keywords outside the section.
Use meta keywords as part of a broader SEO strategy, not the only method.