Menu
×
   ❮     
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP C C++ C# AWS W3.CSS HOW TO BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR ANGULARJS GIT POSTGRESQL SQLITE MONGODB ASP AI R GO KOTLIN SWIFT SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING INTRO TO HTML & CSS BASH RUST DART PLAYWRIGHT TOOLS MATH SHEETS POWER BI

HTML Tutorial

HTML HOME HTML Introduction HTML Editors HTML Basic HTML Elements HTML Attributes HTML Headings HTML Paragraphs HTML Styles HTML Project I HTML Formatting HTML Quotations HTML Comments HTML Colors HTML CSS HTML Project II HTML Links HTML Images HTML Favicon HTML Page Title HTML Tables HTML Lists HTML Project III HTML Block & Inline HTML Div HTML Classes HTML Id HTML Project IV HTML Buttons HTML Iframes HTML JavaScript HTML File Paths HTML Head HTML Layout HTML Responsive HTML Project V HTML Computercode HTML Semantics HTML Project VI HTML Dialog HTML Style Guide HTML Entities HTML Symbols HTML Emojis HTML Character Sets HTML URL Encoding HTML Performance HTML SEO

HTML Forms

HTML Forms HTML Form Attributes HTML Form Elements HTML Input Types HTML Input Attributes Input Form Attributes HTML Project VII

HTML Graphics

HTML Canvas HTML SVG

HTML Media

HTML Media HTML Video HTML Audio HTML YouTube HTML Project VIII

Web Accessibility

Web Accessibility ARIA Attributes Keyboard Focus and tabindex Landmarks Skip Links Color Contrast

Web APIs

Web APIs Geolocation API Drag and Drop API Popover API Web Storage API Web Workers API Server-Sent Events API

HTML Cert

HTML Certificate

HTML Examples

HTML Examples HTML Videos HTML Editor HTML Quiz HTML Exercises HTML Challenges HTML Projects HTML Website HTML Syllabus HTML Study Plan HTML Interview Prep HTML Summary

HTML References

HTML Tag List HTML Attributes HTML Global Attributes HTML Browser Support HTML Event Attributes HTML Colors HTML Canvas HTML Audio/Video HTML Doctypes HTML Character Sets HTML URL Encode HTML Language Codes HTML Country Codes HTTP Status Codes HTTP Request Methods PX to EM Converter Keyboard Shortcuts

HTML SEO and Meta Tags


Share

What is SEO?

SEO (Search Engine Optimization) means making your page easy for search engines like Google and Bing to find, understand, and show in their results.

Meta tags help with this. They are tags in the head section of a page, that give information about the page. Visitors do not see them on the page itself, but search engines, browsers, and social media sites read them.

Example

<head>
  <title>Learn HTML</title>
  <meta name="description" content="Free HTML tutorial with examples.">
</head>

Title and Description

These two tags decide what people see about your page in search results, so they are the most important ones to get right.

The title Tag

The title is shown as the blue clickable headline in search results and in the browser tab.

Example

<title>HTML Tables Tutorial - Learn with Examples</title>

Things to do:

  • Give every page its own, unique title
  • Put the most important words first
  • Keep it to about 50-60 characters, so it is not cut off

The meta Description

The description is often shown as the short text under the title in search results. It does not change your ranking directly, but a good description makes more people click.

Example

<meta name="description" content="Learn how to create HTML tables with rows, columns, and headers. Try every example yourself in our online editor.">

Things to do:

  • Describe what the page offers in one or two sentences
  • Keep it to about 150-160 characters
  • Write a different description for each page

Note: Search engines sometimes write their own snippet instead of using your description, for example when another part of the page fits the search better.



Other Important Head Tags

Tag What it does
<meta charset="UTF-8"> Makes sure all characters show correctly
<meta name="viewport" content="width=device-width, initial-scale=1.0"> Makes the page fit phone screens. Search engines favor mobile-friendly pages
<html lang="en"> Tells search engines and screen readers the language of the page
<link rel="canonical" href="..."> Names the main address of a page that can be reached at more than one URL
<meta name="robots" content="..."> Tells search engines whether to show the page and follow its links

Canonical links

The same page can often be reached at several addresses, like example.com/shoes and example.com/shoes?color=red. The canonical link tells search engines which address is the real one, so they do not treat the others as duplicates:

Example

<link rel="canonical" href="https://example.com/shoes">

Robots

By default, search engines show your pages and follow your links. Use the robots tag only when you want something else:

Example

<!-- Do not show this page in search results -->
<meta name="robots" content="noindex">

<!-- Do not show it, and do not follow its links -->
<meta name="robots" content="noindex, nofollow">

This is useful for pages like a thank-you page or an internal search results page.


Open Graph

When someone shares a link on Facebook, LinkedIn, Slack, or in a chat app, a small preview card often appears with a picture, a title, and a short text.

Open Graph tags decide what that card shows. Without them, the site has to guess, and the preview may show the wrong image or no image at all.

Example

<meta property="og:title" content="HTML Tables Tutorial">
<meta property="og:description" content="Learn how to create HTML tables with examples.">
<meta property="og:image" content="https://example.com/images/tables.png">
<meta property="og:url" content="https://example.com/html/tables">
<meta property="og:type" content="article">

Note: Open Graph tags use property, not name.

Value What it sets
og:title The title on the card
og:description The short text under the title
og:image The picture. Use a full URL, starting with https://
og:url The main address of the page
og:type The kind of content, like website or article
og:site_name The name of your website

Tips for og:image

  • A size of 1200x630 pixels works well on most sites
  • Keep important text and logos away from the edges, since some sites crop the image
  • Use a full address, like https://example.com/image.png, not a relative path

X (Twitter) Cards

X reads Open Graph tags too, but it needs one extra tag to show a large image:

Example

<meta name="twitter:card" content="summary_large_image">

Test your preview

Most social sites save a copy of the preview. If you change your tags, use the site's link preview or debugging tool to refresh it.


A Complete Example

Here is a <head> section with all the tags from this page:

Example

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">

  <!-- Search engines -->
  <title>HTML Tables Tutorial - Learn with Examples</title>
  <meta name="description" content="Learn how to create HTML tables with rows, columns, and headers.">
  <link rel="canonical" href="https://example.com/html/tables">

  <!-- Social media -->
  <meta property="og:title" content="HTML Tables Tutorial">
  <meta property="og:description" content="Learn how to create HTML tables with examples.">
  <meta property="og:image" content="https://example.com/images/tables.png">
  <meta property="og:url" content="https://example.com/html/tables">
  <meta property="og:type" content="article">
  <meta property="og:site_name" content="Example Tutorials">
  <meta name="twitter:card" content="summary_large_image">
</head>

SEO - Beyond Meta Tags

Meta tags help, but search engines mostly look at the content of your page.

Good HTML makes the content easy to understand. Follow these rules:

  • One <h1> per page that says what the page is about, then <h2> and <h3> in order
  • Semantic elements like <main>, <nav>, and <article>, so the structure is clear
  • Alt text on images, so search engines know what each image shows
  • Descriptive link text, like "Read the HTML tutorial" instead of "Click here"
  • Fast loading, since slow pages can rank lower

What about the <meta name="keywords"> tag?

You may see this tag in older code:

Example

<meta name="keywords" content="html, tables, tutorial">

Search engines do not use it for ranking anymore. It was misused so much in the past that search engines stopped trusting it. You can leave it out.


Free account

Track your progress

XP earned 0 Day streak 0 Spaces 0 League —

New

Learn in Adventure Mode W3Schools Adventure App

Coding fundamentals as bite-sized lessons and challenges.

×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookies and privacy policy.

Copyright 1999-2026 by W3Schools. All Rights Reserved. W3Schools is Powered by W3.CSS.