HTML Meta Tags & SEO
debt(d7/e3/b3/t5)
Closest to 'only careful code review or runtime testing' (d7), slightly better at d7. Tools listed are Lighthouse, Google Search Console, and Screaming Frog — these are specialist audit/crawl tools, not inline linters or compilers. Missing meta tags, duplicate descriptions, or absent canonicals won't surface during development; you need to run an explicit SEO audit or wait for search ranking signals, making it closer to d7 than d5.
Closest to 'simple parameterised fix' (e3). The quick_fix is adding unique <title> and <meta name='description'> per PHP-rendered page plus Open Graph tags and canonicals — a small, repeatable pattern applied per page/template. It's more than a single-line patch but doesn't span multiple components architecturally; fixing a PHP template or layout file covers most cases.
Closest to 'localised tax' (b3). The applies_to scope is web context only, and meta tag management is typically handled in a layout/template file or a thin SEO helper. It imposes a small ongoing discipline (each new page needs unique tags) but doesn't reshape the architecture or create cross-cutting concerns across the codebase.
Closest to 'notable trap' (t5). The misconception field explicitly states that meta keywords still matter — a documented gotcha that many beginners carry as a false belief. Additionally, missing canonical tags on paginated URLs and duplicate descriptions are common_mistakes that a competent developer might easily overlook. This is a well-known documented trap rather than a catastrophic or architectural one.
Also Known As
TL;DR
Explanation
Key meta tags: title (50-60 chars, unique per page), meta description (150-160 chars, compelling summary), meta robots (index/noindex, follow/nofollow), canonical (prevents duplicate content penalties), Open Graph (og:title, og:description, og:image — for Facebook/LinkedIn sharing), Twitter Card (twitter:card, twitter:image), and lang attribute on html element. Structured data (JSON-LD with Schema.org) enables rich snippets in search results — FAQPage, Product, Article, BreadcrumbList. Each PHP page template should generate unique, meaningful meta tags dynamically.
Common Misconception
Why It Matters
Common Mistakes
- Same meta description on every page — each page needs a unique, descriptive description.
- Missing canonical tag on paginated pages — /products?page=2 competes with /products.
- Open Graph image not specified — social shares show a blank or incorrect image.
- Title tag over 60 characters — truncated in search results.
Code Examples
<!-- Static/missing meta — same on every page:
<title>My Website</title>
<!-- No meta description -->
<!-- No canonical -->
<!-- No Open Graph -->
<!-- Dynamic meta in PHP template:
<title><?= esc($page->title) ?> | CodeClarityLab</title>
<meta name="description" content="<?= esc($page->description) ?>">
<link rel="canonical" href="<?= esc($page->canonicalUrl) ?>">
<!-- Open Graph:
<meta property="og:title" content="<?= esc($page->title) ?>">
<meta property="og:description" content="<?= esc($page->description) ?>">
<meta property="og:image" content="<?= esc($page->ogImage) ?>">
<meta property="og:type" content="article">
<!-- Structured data:
<script type="application/ld+json">
<?= json_encode(['@context'=>'https://schema.org','@type'=>'Article','name'=>$page->title]) ?>
</script>