SEO and Meta Tags
SEO Fundamentals
Search Engine Optimization helps search engines understand, crawl, and rank your content. Good SEO starts with clean, semantic HTML — not keyword stuffing or hidden text.
Google evaluates relevance, quality, technical health, and Core Web Vitals (page experience).
Essential Meta Tags
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Learn Python — Complete Tutorial | GazeHub</title>
<meta name="description" content="Master Python from beginner to expert with hands-on tutorials covering syntax, OOP, web development, and data science.">
<link rel="canonical" href="https://www.gazehub.com/docs/backend/python/5intro/">
<meta name="robots" content="index, follow">
</head>
| Tag | Guidelines |
|---|---|
| title | 50–60 characters; unique per page; primary keyword near start |
| description | 150–160 characters; compelling summary for SERP snippets |
| canonical | Prevents duplicate content when same page has multiple URLs |
| robots | noindex for admin, staging, or thin pages |
Open Graph and Twitter Cards
Control how links appear when shared on social platforms:
<meta property="og:title" content="Learn Python — GazeHub">
<meta property="og:description" content="Complete Python tutorial from beginner to expert.">
<meta property="og:image" content="https://www.gazehub.com/images/python-og.png">
<meta property="og:url" content="https://www.gazehub.com/docs/backend/python/">
<meta property="og:type" content="website">
<meta property="og:site_name" content="GazeHub">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:title" content="Learn Python — GazeHub">
<meta name="twitter:description" content="Complete Python learning path.">
<meta name="twitter:image" content="https://www.gazehub.com/images/python-og.png">
OG images should be at least 1200×630px, under 8MB, with important content centered (cropping varies by platform).
Structured Data (JSON-LD)
Help search engines understand content type and enable rich results:
<script type="application/ld+json">
{
"@context": "https://schema.org",
"@type": "Course",
"name": "Python Tutorial",
"description": "Complete Python learning path",
"provider": {
"@type": "Organization",
"name": "GazeHub",
"url": "https://www.gazehub.com"
}
}
</script>
Validate with Google Rich Results Test. Common types: Article, FAQPage, BreadcrumbList, Organization.
Heading Hierarchy
Use one <h1> per page with logical nesting:
<h1>Python Tutorial</h1>
<h2>Getting Started</h2>
<h3>Installing Python</h3>
<h3>Your First Script</h3>
<h2>Data Types</h2>
Headings create a document outline — don’t skip levels for styling (use CSS instead).
URLs and Internal Linking
- Use descriptive, readable URLs:
/docs/python/installation/not/p?id=42 - Link related content with descriptive anchor text (“Python functions guide”) not “click here”
- Maintain a logical site hierarchy reflected in breadcrumbs
<nav aria-label="Breadcrumb">
<ol>
<li><a href="/docs/">Docs</a></li>
<li><a href="/docs/backend/python/">Python</a></li>
<li aria-current="page">Installation</li>
</ol>
</nav>
Performance and SEO
Google considers Core Web Vitals:
| Metric | Target | HTML/CSS impact |
|---|---|---|
| LCP | < 2.5s | Optimize hero images, preload critical assets |
| INP | < 200ms | Defer non-critical JS |
| CLS | < 0.1 | Set width/height on images, reserve ad space |
<img src="hero.webp" alt="..." width="1200" height="630" loading="lazy" fetchpriority="high">
<link rel="preload" href="/fonts/inter.woff2" as="font" type="font/woff2" crossorigin>
Technical SEO Checklist
- Unique
<title>and meta description per page - One
<h1>with keyword relevance - Canonical URL set
- Mobile-friendly viewport meta tag
- Valid HTML (no broken nesting)
-
robots.txtand XML sitemap submitted to Search Console - HTTPS enabled
- Structured data where applicable
- Internal linking between related docs
- Fast page load (Lighthouse performance > 90)
Common SEO Mistakes
| Mistake | Fix |
|---|---|
| Duplicate titles across pages | Unique title per URL |
| Missing canonical on paginated content | Point to view-all or use rel="next/prev" |
| Blocking CSS/JS in robots.txt | Google needs them to render pages |
| Keyword stuffing in meta tags | Write for humans first |
Troubleshooting
Page not indexed
- Check
robotsmeta androbots.txt - Submit URL in Google Search Console
- Ensure page is linked from sitemap or internal links
Wrong snippet in search results
- Google may rewrite title/description — improve relevance and click-through copy
Rich results not showing
- Validate JSON-LD; not all schema types trigger rich results
SEO is an ongoing practice — combine semantic HTML, fast performance, and valuable content for sustainable rankings.