Metadata or meta tags in HTML

Metadata in HTML is used to provide additional information about an HTML document. This information is not displayed directly on the web page, but it can be used by search engines, browsers, and other systems to understand and classify the content of the document.
8. Metadata or meta tags in HTML
These tags are placed between the <head>
and </head>
tags. Some of the most common meta tags for metadata in HTML are:
<title>
: Defines the title of the document, which is displayed in the browser’s title bar and search results.<meta charset="UTF-8">
: Specifies the character encoding used in the document. UTF-8 is the most commonly used encoding to support multilingual characters.<meta name="description" content="Description of the website">
: Provides a brief description of the website’s content. It is used by search engines to display information about the site in search results.<meta name="keywords" content="word1, word2">
: Specifies keywords related to the website’s content. Although not as relevant for modern search engines, it can still be used to understand the website’s theme.<meta name="viewport" content="width=device-width, initial-scale=1.0">
: Defines how the content should adjust and scale on mobile devices. It is important for achieving a responsive design. See viewport meta tag configuration.<meta name="author" content="Name of the author">
: Specifies the name of the document’s author.<meta name="copyright" content="Year of the copyright, name of the author's rights">
: Indicates the copyright of the document.<meta name="robots" content="index,follow">
: Instructs search engines whether they should index and follow links within the document.
Example
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="description" content="Site description"> <meta name="keywords" content="keyword1, keyword2"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="author" content="Author's Name"> <meta name="copyright" content="2023, Rights Holder"> <meta name="robots" content="index,follow"> <title>Site Metadata</title> </head> <body> <!-- Website content --> </body> </html>