← All framework guides

Laravel SEO: 5 checks and how to fix them

These are the Laravel-specific checks RankCLI runs, and the fix for each one in Laravel's own idiom. Laravel renders on the server by default, which removes a whole class of SEO problems before you start.

5 checks
1 rated error
server-rendered
SSR by default

Run all of these against your own site, free and without an account:

npx @rankcli/cli audit -u https://your-site.dev

What Laravel gives you for free

  • •Server-rendered HTML by default
  • •Blade templates for clean SEO markup
  • •Route caching for fast responses
  • •Built-in CSRF and security

The checks

warning
LARAVEL_NO_META_PACKAGE

No SEO package detected

Laravel benefits from an SEO package like artesaos/seotools.

Install artesaos/seotools:

composer require artesaos/seotools
// In controller
use Artesaos\SEOTools\Facades\SEOMeta;

SEOMeta::setTitle('Page Title');
SEOMeta::setDescription('Description');

// In Blade
{!! SEOMeta::generate() !!}
warning
LARAVEL_NO_SITEMAP

No sitemap package detected

Use spatie/laravel-sitemap for automatic sitemaps.

composer require spatie/laravel-sitemap
// Generate sitemap
use Spatie\Sitemap\SitemapGenerator;

SitemapGenerator::create('https://yoursite.com')
    ->writeToFile(public_path('sitemap.xml'));

// Or build manually
use Spatie\Sitemap\Sitemap;
use Spatie\Sitemap\Tags\Url;

Sitemap::create()
    ->add(Url::create('/')->setPriority(1.0))
    ->add(Url::create('/about'))
    ->writeToFile(public_path('sitemap.xml'));
error
LARAVEL_INERTIA_NO_SSR

Inertia.js without SSR

Inertia apps are client-rendered by default, losing SEO benefits.

Enable Inertia SSR:

php artisan inertia:start-ssr

Configure in config/inertia.php:

'ssr' => [
    'enabled' => true,
    'url' => 'http://127.0.0.1:13714',
],
notice
LARAVEL_NO_RESPONSE_CACHE

Response caching not configured

Cache full responses for better performance.

Install spatie/laravel-responsecache:

composer require spatie/laravel-responsecache

Add middleware:

// app/Http/Kernel.php
protected $middlewareGroups = [
    'web' => [
        \Spatie\ResponseCache\Middlewares\CacheResponse::class,
    ],
];
warning
LARAVEL_LIVEWIRE_SEO

Livewire components may affect SEO

Livewire content loads via JavaScript after initial page load.

For SEO-critical content, use wire:init to load immediately:

<div wire:init="loadData">
    @if($data)
        {{-- Content --}}
    @else
        {{-- Loading skeleton --}}
    @endif
</div>

Or use Alpine.js for client-only interactions.

Check your own Laravel site

280+ checks including every one above. No signup, nothing leaves your machine.

Run a free audit