Documentation

SEO

Rich, automatic SEO and social meta for every page — with per-page overrides.

On this page 12

Every Laradocs page ships with a full set of SEO and social meta tags, generated by ralphjsmit/laravel-seo. You get a sensible <title>, a meta description, Open Graph and Twitter cards, a canonical URL and JSON-LD structured data — out of the box, with nothing to configure.

Good defaults are derived automatically from each page's content and front-matter. When you want control, every field can be overridden per page.

What you get for free

For a page with no SEO configuration at all, Laradocs emits:

  • a <title> of the page title plus your brand name, e.g. Routing · Acme Docs;
  • a <meta name="description"> taken from the page's description:, or — when that's absent — derived from the opening paragraph of the page;
  • Open Graph tags (og:title, og:description, og:type, og:url, og:image, og:site_name, article published/modified times);
  • Twitter card tags;
  • a self-referencing <link rel="canonical">;
  • a robots directive tuned for rich snippets;
  • the site favicon;
  • JSON-LD structured data: an Article block and a BreadcrumbList reflecting the page's place in the navigation.

Configuration

Site-wide defaults live under the seo key in config/laradocs.php, and every one is environment-driven:

Option Env Default
seo.enabled LARADOCS_SEO true
seo.site_name LARADOCS_SEO_SITE_NAME ui.brand.title
seo.title_suffix LARADOCS_SEO_TITLE_SUFFIX · {site_name}
seo.description LARADOCS_SEO_DESCRIPTION ui.brand.tagline
seo.auto_description LARADOCS_SEO_AUTO_DESCRIPTION true
seo.image LARADOCS_SEO_IMAGE null
seo.author LARADOCS_SEO_AUTHOR null
seo.twitter LARADOCS_SEO_TWITTER null
seo.type LARADOCS_SEO_TYPE article
seo.robots LARADOCS_SEO_ROBOTS package default
seo.schema.article LARADOCS_SEO_SCHEMA_ARTICLE true
seo.schema.breadcrumbs LARADOCS_SEO_SCHEMA_BREADCRUMBS true

A minimal real-world setup is usually just two values:

dotenv
LARADOCS_SEO_SITE_NAME="Acme Docs"
LARADOCS_SEO_IMAGE=https://acme.test/og/docs.png

Title suffix

By default the brand name is appended to every page title, so Routing renders as Routing · Acme Docs. The home page — whose title already is the site name — is left un-suffixed to avoid Acme Docs · Acme Docs.

Set your own separator and wording with title_suffix:

dotenv
LARADOCS_SEO_TITLE_SUFFIX=" — Acme Documentation"

Set it to an empty string to drop the suffix entirely:

dotenv
LARADOCS_SEO_TITLE_SUFFIX=""

Automatic descriptions

When a page has no description: in its front-matter, Laradocs lifts a clean, plain-text excerpt from its first paragraph — skipping headings, code blocks and markup. Prefer to only ever use explicit descriptions? Turn the behaviour off:

dotenv
LARADOCS_SEO_AUTO_DESCRIPTION=false

Per-page overrides

The simple keys

The everyday front-matter keys feed SEO directly — no extra ceremony:

markdown

---

title: Routing
description: How URLs are generated and matched.
image: /og/routing.png
author: Pete
tags: [routing, urls]

---

  • title<title>, og:title, twitter:title
  • descriptionmeta description, og:description, twitter:description
  • imageog:image, twitter:image
  • author → article author meta + schema
  • tagsarticle:tag entries

The seo: block

For SEO-specific control that shouldn't change what's shown on the page, use a dedicated seo: block. Its values win over the top-level keys:

markdown

---

title: Internal Notes
description: Shown as the page subtitle.
seo:
  title: A different title, just for search engines
  description: A different description, just for the meta tags.
  image: /og/custom.png
  robots: noindex, nofollow
  canonical: https://acme.test/canonical/url
  type: website

---

seo: key Effect
title Overrides the SEO/social title only (the on-page <h1> is unchanged).
description Overrides the meta/social description only.
image Open Graph / Twitter image.
author Author meta + schema.
tags article:tag entries.
robots Robots directive, e.g. noindex, nofollow.
canonical Canonical URL for this page.
type Open Graph type (article, website, …).
section Open Graph article:section; defaults to the page group.

Hiding a page from search engines

The noindex shorthand expands to robots: noindex, nofollow — handy for work-in-progress or internal pages that still need a public URL:

markdown

---

title: Draft
noindex: true

---

Or hide the entire docs site from crawlers via config:

dotenv
LARADOCS_SEO_ROBOTS="noindex, nofollow"

Publication dates

Open Graph article timestamps come for free: the modified time is taken from the file's last-modified time on disk, and you can set a publication date with published_at (or date) in front-matter:

markdown

---

title: Release Notes
published_at: 2026-01-15

---

Structured data (JSON-LD)

Each page emits an Article and a BreadcrumbList as <script type="application/ld+json">. The breadcrumb trail mirrors your navigation — Home › Guide › SEO — which helps search engines render breadcrumb-rich results.

Disable either independently:

dotenv
LARADOCS_SEO_SCHEMA_ARTICLE=true
LARADOCS_SEO_SCHEMA_BREADCRUMBS=false

Turning it off

Set seo.enabled to false and Laradocs falls back to a plain <title> and <meta name="description"> with no Open Graph, Twitter or JSON-LD:

dotenv
LARADOCS_SEO=false

Going further

Under the hood, Laradocs hands a SEOData object to the SEO package for every page. If you've published the package's own config (config/seo.php) or want to reshape tags globally, you can register a transformer from any service provider — it runs after Laradocs has populated the data:

php
use RalphJSmit\Laravel\SEO\Facades\SEOManager;
use RalphJSmit\Laravel\SEO\Support\SEOData;

SEOManager::SEODataTransformer(function (SEOData $data): SEOData {
    $data->twitter_username = 'acme';

    return $data;
});

See the ralphjsmit/laravel-seo docs for the full transformer and schema API.