DomainLens

Guides

Laravel SEO Checklist: Routes, Rendering, Metadata & Sitemaps

Laravel does not add or break SEO by itself. Your routes, controllers, templates, middleware, and deployment pipeline decide what crawlers receive.

Vérifiez votre site avant de corriger

Lancez un audit DomainLens frais et utilisez le rapport comme liste de priorités.

Lancer un audit SEO gratuit

Make HTTP behaviour part of the route contract

Every public route should have an intentional status, indexability state, canonical URL, and representation. Test those properties like application behaviour. A pretty error component returned with 200 becomes a soft 404; a moved resource handled by client-side navigation hides the redirect from crawlers.

Feature test for an indexable page
public function test_product_page_is_indexable(): void
{
    $response = $this->get('/products/blue-widget');

    $response->assertOk();
    $response->assertSee('<h1>Blue Widget</h1>', false);
    $response->assertSee(
        '<link rel="canonical" href="https://example.com/products/blue-widget">',
        false,
    );
    $response->assertDontSee('noindex', false);
}

Choose a rendering strategy per page type

Google can render JavaScript, but its JavaScript SEO guidance still recommends server-side or pre-rendering because users and other crawlers receive content sooner.

RenderingSuitable forSEO verification
Blade SSRContent pages and server-driven applicationsMeaningful HTML in the first response
Inertia SSRInteractive Vue/React pages with server routingSSR service returns body and head; hydration matches
Static generation/cacheStable high-traffic landing pagesFreshness and invalidation are tested
Client-only SPAAuthenticated/non-search application areasPublic SEO pages should not ship only an app shell

Generate metadata from trusted server state

  • Create one title and meta description per indexable entity; do not let both Blade and the SPA emit them.
  • Build absolute canonicals from a configured production origin plus the normalized route, never directly from an untrusted Host header.
  • Keep canonical, Open Graph URL, sitemap URL, internal links, and redirects on the same HTTPS host.
  • For localized routes, emit self-canonicals and reciprocal hreflang only for translations that really exist.
  • Use the entity’s created and modified timestamps in Article schema; omit unsupported properties rather than inventing them.
Canonical in a Blade layout
<link rel="canonical" href="{{ url()->route('products.show', $product, absolute: true) }}">

Keep discovery finite and canonical

Generate sitemaps from published, indexable records rather than from the route list. Exclude redirects, drafts, noindex pages, private dashboards, parameter variants, and deleted models. lastmod should change when the page’s meaningful public representation changes.

  • Use ordinary anchor href values for pagination and related content.
  • Bound filters and search combinations; do not expose arbitrary query strings as crawlable landing pages.
  • Resolve route-model misses with 404 or 410, not an empty 200 view.
  • Map renamed slugs to one-hop 301 redirects and test loops/chains.

Laravel performance diagnosis follows the request lifecycle

  1. 1Measure TTFB with caches cold and warm. Confirm whether full-page, response, object, and CDN caches actually hit.
  2. 2Use query logging/profiling to find N+1 queries, slow joins, serialization, remote API calls, and session locks.
  3. 3Queue non-essential work and precompute expensive public aggregates.
  4. 4Build and version frontend assets; preload only resources required above the fold.
  5. 5For Inertia SSR, monitor the SSR process and fail deployments when the bundle or service is unavailable.

A Laravel SEO release gate

Run route, content, and sitemap tests in CI; build the client and SSR bundles; clear/rebuild production caches in the correct order; then crawl production samples. For an Inertia/Vue front end, add the Vue SPA SEO checklist . DomainLens verifies environment-level output such as APP_URL, cached head tags, SSR bundle, and proxy redirects.

Ressources associées