Laravel + SEO = Excellent Foundation
Unlike SPAs, Laravel renders HTML server-side by default, so Google can crawl content immediately. But there's still plenty to configure to rank competitively.
1. SEO Meta Tags Per Route
- Use a package like artesaos/seotools or noeldemartin/laravel-seo
- Set unique title (≤60 chars), description (≤160 chars), canonical, og:* per page
- Never let the homepage canonical leak to inner pages
2. Clean URL Structure
- Use route slugs not numeric IDs — /blog/{slug} not /blog/123
- Force lowercase URLs with middleware
- Force HTTPS in AppServiceProvider with URL::forceScheme
- Add trailing slash policy and 301 redirects to canonical form
3. XML Sitemap Generation
- Use spatie/laravel-sitemap for dynamic auto-discovery
- Generate per content type — sitemap-posts.xml, sitemap-products.xml
- Wrap in sitemap-index.xml
- Schedule daily regeneration via Laravel Task Scheduler
4. Structured Data (JSON-LD)
- spatie/schema-org makes Article, Product, FAQPage, BreadcrumbList trivial
- Inject in the head via Blade @push directive
- Validate every template with Google Rich Results Test
5. Performance & Core Web Vitals
- Cache views with route:cache, config:cache, view:cache in production
- Use Redis for session, cache, and queue
- Enable Octane (Swoole/RoadRunner) for 5-10x throughput
- Use Laravel Mix or Vite for asset bundling with code splitting
- Set HTTP/2 + Brotli at the web server
6. Image Optimization
- spatie/laravel-medialibrary for automated responsive image generation
- WebP/AVIF conversions on upload
- Native loading="lazy" on all non-LCP images
7. Internationalization & hreflang
- Use locale prefix routing (/en/, /de/, /fr/)
- Output hreflang tags for every alternate URL
- Translate meta tags via lang files or DB-backed translations
8. Vue/Inertia SPA Routes
If you're using Inertia or a Vue SPA section, render meta tags server-side in the Blade root or use SSR via @inertiajs/server. Otherwise Google may index empty pages.
9. Indexing & Crawl Hygiene
- Robots middleware: noindex on staging/admin/auth pages
- Add Sitemap directive in /robots.txt
- Submit XML sitemap in GSC and Bing Webmaster
- Use Laravel Telescope or Sentry to catch 5xx errors before Googlebot does
Building a Laravel app and want it SEO-ready from day one? Hire me for Laravel development.