All rules

Sheath rule

seo-meta-description

HTML documents should have a meta description.
Package
Core
Category
SEO
Default severity
info by default
Auto-fix
Manual fix

#Why

Search engines and social platforms need a summary line for a page. Given one, they usually use it; given none, they assemble something from whatever text they find first, which is often navigation or a cookie banner.

It is also the fallback several platforms use when og:description is absent.

#Examples

#Bad

<!-- Missing meta description -->
<head>
<meta charset="utf-8">
<title>My Page</title>
</head>
<!-- Empty description -->
<head>
<meta name="description" content="">
</head>
<!-- Too short (under 50 chars) -->
<head>
<meta name="description" content="A page about stuff.">
</head>
<!-- Too long (over 160 chars) -->
<head>
<meta name="description" content="This is an extremely long meta description that goes on and on about various topics without getting to the point, which means search engines will truncate it in search results and users won't see the full message you're trying to convey.">
</head>

#Good

<!-- Optimal length (50-160 chars) -->
<head>
<meta name="description" content="Learn how to optimize your Laravel Blade templates with Sheath. Get real-time linting, auto-fixes, and best practice enforcement.">
</head>
<!-- Dynamic description -->
<head>
<meta name="description" content="{{ $post->excerpt }}">
</head>
<!-- With fallback -->
<head>
<meta name="description" content="{{ $page->meta_description ?? config('app.description') }}">
</head>

#Length Guidelines

Use these ranges as editing guidance; search engines may display different lengths.

Metric Value Notes
Minimum 50 chars Too short lacks context
Optimal 120-155 chars Sweet spot for most pages
Maximum 160 chars Google truncates beyond this

#Options

Use these options to set the accepted description length range.

Option Type Default Description
minLength int 50 Minimum description length
maxLength int 160 Maximum description length
<?php
'seo-meta-description' => ['warning', [
'minLength' => 70,
'maxLength' => 155,
]],

#Writing Good Descriptions

  1. Be specific: Describe the actual page content
  2. Include keywords: Use relevant terms naturally
  3. Call to action: Encourage clicks where appropriate
  4. Unique per page: Don't duplicate across pages
  5. Match content: Ensure description reflects page content

#Notes

  • A dynamic name value is left for runtime and suppresses the missing-tag diagnostic.
  • A description inside Blade control flow must exist on every render path.
  • Only documents with a <head> element are checked
  • A missing meta description is not reported when <head> contains dynamic content such as <x-seo>, <s:se_meta>, @include, @stack, @yield, or {!! ... !!}
  • Search engines may ignore your description and generate their own
  • Each page should have a unique description
  • Dynamic Blade descriptions satisfy presence checks but are not subjected to static length limits
  • When several description elements are present, each static declaration is validated at its own location. See best-practices-no-duplicate-in-head for duplicate declarations

#Related Rules