← Learning Hub
Intermediate

The Head, Meta Tags and SEO

Everything inside <head> is information about the page. Users don't see it on the page, but browsers, Google and WhatsApp previews read it.

The head is like the label on a product box: it doesn't change what's inside, but it tells everyone what the box is. When you share a link on WhatsApp and see a title, description and picture, those come from meta tags in the head. When Google shows your page in search results, the blue title and the grey description usually come from here too.

Example
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>Handmade Diyas - Asha Crafts, Jaipur</title>
    <meta name="description" content="Clay diyas painted by hand in Jaipur. Order online, delivered across India.">
    <link rel="icon" href="favicon.png">
    <link rel="stylesheet" href="style.css">
    <link rel="canonical" href="https://ashacrafts.example/diyas">

    <!-- How the link looks when shared on WhatsApp, Facebook or LinkedIn -->
    <meta property="og:title" content="Handmade Diyas - Asha Crafts">
    <meta property="og:description" content="Clay diyas painted by hand in Jaipur.">
    <meta property="og:image" content="https://ashacrafts.example/diyas.jpg">
  </head>
  <body>
    <h1>Handmade Diyas</h1>
  </body>
</html>
  • charset="UTF-8" - lets every language show correctly (Hindi, emojis, ₹)
  • viewport - without it, phones show a tiny zoomed-out desktop page
  • <title> - the tab name and the blue link text on Google
  • description - the short text under the link on Google
  • canonical - tells search engines the main address when the same page has several
  • og: tags - the title, text and picture of a shared link preview

Simple SEO habits

SEO is how people find your site for free. Google wants to show the most useful page for each search, so it reads your titles, headings, text and links, and checks that the page is fast and works on phones. You can't trick it for long - the best SEO is clear structure plus genuinely helpful content.

  • Write one clear <h1> per page, then <h2>, <h3> in order.
  • Keep titles under about 60 characters and descriptions under about 155.
  • Use real words in addresses: /diyas is better than /p?id=73.
  • Add alt text to images and link with words that say where the link goes.
  • Make pages fast and readable on phones.
SEO means Search Engine Optimisation: making pages easy for search engines to understand. Good content that answers people's questions matters more than any tag.
Key points
  • The head holds information about the page: charset, viewport, title, description.
  • Title and description appear in Google results and link previews.
  • Good SEO = clear structure + helpful content + fast mobile pages.

📝 Test yourself

1. What does the viewport meta tag fix?
2. Where does Google usually take the blue link text from?
3. Fill in the meta name for the short text shown under a search result:
<meta name="" content="...">