HTML <meta> elements provide metadata about a document. They belong inside the <head> and are not displayed as normal page content.
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A concise description of the page.">
<title>HTML Meta Tags Example</title>
</head>
The meta description summarizes the page. It is placed inside the document head:
<meta name="description" content="Learn HTML forms with text fields, radio buttons, checkboxes and select lists.">
A good description should accurately summarize the specific page and make sense when read independently.
The meta description is not visible as normal body text, so the page itself still needs a clear heading and useful introductory content.
The older HTML page used a keywords meta tag like this:
<meta name="keywords" content="HTML tutorial, HTML tags, web page">
This tag is now obsolete for normal SEO work. Google does not use the keywords meta tag for web ranking, and adding a list of target keywords does not replace writing relevant page content.
meta name="keywords" from new pages unless you have a separate internal system that specifically consumes it.Declare the document character encoding near the beginning of the head:
<meta charset="UTF-8">
UTF-8 is the normal choice for modern web pages because it can represent a very large range of characters.
The viewport meta tag helps mobile browsers size the layout to the device width.
<meta name="viewport" content="width=device-width, initial-scale=1">
This is a common starting point for responsive layouts.
The robots meta tag can give indexing and link-following instructions to compatible search-engine crawlers.
<meta name="robots" content="index, follow">
For a normal indexable page, explicitly writing index, follow is usually unnecessary because those are the ordinary defaults for crawlable pages.
When a page should not appear in search results, use:
<meta name="robots" content="noindex">
You can also target a specific supported crawler with its crawler name:
<meta name="googlebot" content="noindex">
noindex instruction.To tell compatible crawlers not to follow links on the entire page:
<meta name="robots" content="nofollow">
This is a page-wide directive. When the concern is only one particular link, apply the appropriate rel value to that link instead of changing the whole page.
nofollow to every link on the document.If compatible search engines should not index images embedded on a page, a robots directive can be used:
<meta name="robots" content="noimageindex">
This is clearer than the old example that attempted to use Googlebot-Image with a generic noindex value.
You can provide an author name as document metadata:
<meta name="author" content="Subhendu Mohapatra">
This is optional document metadata. It is not a requirement for a page to be indexed, and it should not be treated as an SEO ranking technique.
For visible authorship, use normal page content that identifies the author and provides useful information about them.
This example asks the browser to reload the current page after 15 seconds:
<meta http-equiv="refresh" content="15">
A timed refresh can interrupt users who are reading or interacting with the page, so use it only when automatic refresh is genuinely necessary.
<meta http-equiv="refresh" content="5; url=https://www.example.com/new-page">
For normal permanent or temporary URL redirects, an HTTP server-side redirect is generally preferable because it communicates the redirect directly at the HTTP level.
More about the Meta Refresh Tag
Older pages often contain metadata such as:
<meta name="revisit-after" content="2 days">
<meta name="keywords" content="html, tutorial, web page">
<meta name="robots" content="index, follow">
revisit-after is not a useful way to control when search engines recrawl a page.keywords is not needed for modern search-engine ranking.index, follow is normally redundant on an ordinary crawlable page.<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="Learn the main HTML meta tags used in modern web pages.">
<title>HTML Meta Tags Example</title>
</head>
<body>
<h1>HTML Meta Tags</h1>
</body>
</html>
See HTML title tag, HTML body tag, and HTML page structure.
Do not rely on meta keywords for ranking. Put effort into useful page content, descriptive titles and accurate metadata instead.
The description should reflect the specific page rather than repeating the same boilerplate everywhere.
Search-result snippets vary. Write a concise summary that communicates the page clearly.
Responsive CSS and flexible content are still required.
Use appropriate link-level attributes when only particular links need special treatment.
A crawler normally has to fetch the page before it can read a meta robots directive.
Use HTTP redirects for normal URL moves. Use timed refresh only when the page genuinely requires it.
Meta elements belong inside the head section of the HTML document.
It provides a concise summary of the page that search engines may use when presenting the page in search results.
For normal SEO work, no. Google does not use the keywords meta tag for web ranking.
A common responsive starting point is width=device-width, initial-scale=1.
For compatible crawlers, use a robots meta directive with noindex on a page the crawler can access.
No. Those are normally the default behaviors for an ordinary crawlable page.
Usually no. HTTP redirects are generally preferable for normal URL redirects.
Author & Instructor at plus2net
I write and maintain practical tutorials on Python, PHP, SQL, JavaScript, HTML, jQuery, and web development at plus2net. The tutorials focus on clear explanations, working examples, and code that readers can test and adapt while learning.
| ronald | 03-07-2010 |
| Its a good example of meta, but would be appreciated if it could have working examples | |