Specifying keywords in HTML is done using the <meta>
tag with the name
attribute set to "keywords". Although search engines like Google have stated that they no longer use the meta keywords tag for ranking, other search engines might still consider them, and they can also be useful for internal search engines on your site.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A brief description of the content on your page.">
<meta name="keywords" content="keyword1, keyword2, keyword3, keyword4, keyword5">
<title>Your Page Title</title>
</head>
<body>
<h1>Hello World!</h1>
<p>This is an example page.</p>
</body>
</html>
<meta name="keywords">
tag is not crucial for SEO with major search engines, using it correctly won't hurt your website. It can still serve a purpose for smaller or specialized search engines and for site search functionality.Here's an enhanced example incorporating meta keywords along with other essential meta tags:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="A comprehensive guide on how to add meta tags to your HTML documents.">
<meta name="keywords" content="HTML, meta tags, SEO, keywords, description, web development">
<title>How to Add Meta Tags to Your HTML Documents</title>
<!-- Open Graph Meta Tags -->
<meta property="og:title" content="How to Add Meta Tags to Your HTML Documents">
<meta property="og:description" content="A comprehensive guide on how to add meta tags to your HTML documents.">
<meta property="og:image" content="http://example.com/image.jpg">
<meta property="og:url" content="http://example.com">
<!-- Twitter Card Meta Tags -->
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="How to Add Meta Tags to Your HTML Documents">
<meta name="twitter:description" content="A comprehensive guide on how to add meta tags to your HTML documents.">
<meta name="twitter:image" content="http://example.com/image.jpg">
</head>
<body>
<h1>Hello World!</h1>
<p>This is an example page.</p>
</body>
</html>