Technical SEO Checklist for Laravel Applications
Laravel is one of the most powerful PHP frameworks available, but its flexibility means that SEO considerations are left to the developer rather than handled automatically. Unlike platforms with built-in SEO features, a Laravel application requires deliberate implementation of every technical SEO element. The upside is complete control. The downside is that nothing happens unless you build it.
This checklist covers the essential technical SEO elements every Laravel application should implement, from foundational meta tags to advanced structured data and server-side performance optimizations.
Meta Tags and Head Elements
Title Tags
Every page needs a unique, descriptive title tag between 50 and 60 characters. In Laravel, the cleanest approach is to use a Blade layout that accepts a title variable from each view. Avoid generic titles like "Home" or "Page" and instead craft titles that include your primary keyword and brand name.
Use a consistent format across your site, such as "Primary Keyword - Secondary Context | Brand Name." For dynamic pages like blog posts or product listings, pull the title from the database and sanitize it with Laravel's e() helper to prevent XSS while keeping the output clean for search engines.
Meta Descriptions
Meta descriptions don't directly influence rankings, but they significantly impact click-through rates from search results. Keep them under 160 characters, make them compelling, and include a call to action. In Laravel, store meta descriptions alongside your content models and render them in your layout's head section.
Canonical URLs
Canonical tags tell search engines which version of a page is the "official" one. This prevents duplicate content issues caused by URL parameters, pagination, or multiple paths to the same content. In Laravel, generate canonical URLs using the url() or route() helpers and include them on every page.
Pay special attention to pagination. If your blog or product listing uses paginated URLs like /blog?page=2, each paginated page should have its own canonical URL pointing to itself, not back to page one. Additionally, implement rel="prev" and rel="next" link elements to help search engines understand the pagination sequence.
Open Graph and Twitter Cards
While not traditional SEO elements, Open Graph (Facebook) and Twitter Card meta tags control how your pages appear when shared on social media. Shared links with rich previews, including images, titles, and descriptions, receive significantly more engagement than bare URLs. Implement these tags in your Blade layout and populate them from your content models.
XML Sitemaps
An XML sitemap tells search engines about all the pages on your site, their relative importance, and how frequently they change. For Laravel applications, you have several implementation options:
- Package-based: The spatie/laravel-sitemap package can automatically crawl your application and generate a sitemap, or you can define the sitemap contents manually for more control.
- Custom route: Create a dedicated route that generates XML output from your Eloquent models. This gives you complete control over which pages appear, their priorities, and their change frequencies.
- Static generation: For sites with content that changes infrequently, generate the sitemap as a static XML file during deployment using an Artisan command. This avoids runtime overhead.
Whichever approach you choose, register your sitemap in robots.txt and submit it through Google Search Console. For large sites with thousands of pages, use sitemap index files to split the sitemap into manageable chunks of 50,000 URLs or fewer.
Route Optimization for SEO
Clean URL Structure
Laravel's routing system makes it easy to create clean, keyword-rich URLs. Prefer descriptive slugs like /blog/technical-seo-laravel over numeric IDs like /blog/42. Use the getRouteKeyName() method on your Eloquent models to resolve routes by slug instead of ID.
Trailing Slashes
Be consistent with trailing slashes. Search engines treat /about and /about/ as different URLs. Pick one convention and redirect the other using middleware. Laravel doesn't add trailing slashes by default, so if you prefer URLs without them, you're already set. Just ensure no links in your application accidentally include them.
Redirect Management
When you change URL structures, always implement 301 redirects from old URLs to new ones. In Laravel, you can handle this in several ways: dedicated redirect routes in your routes file, middleware that checks a redirects table, or the route-level redirect method. Never leave old URLs returning 404 errors if they had search engine authority.
Structured Data (Schema.org)
Structured data helps search engines understand the content type and context of your pages, enabling rich results like star ratings, FAQ accordions, breadcrumbs, and article metadata in search results.
For Laravel applications, implement structured data as JSON-LD scripts in your Blade templates. The most common schema types for business websites include:
- Organization: Your company name, logo, contact information, and social profiles
- Article or BlogPosting: For blog content, including author, publication date, and featured image
- BreadcrumbList: Navigation breadcrumbs that appear in search results
- FAQPage: Frequently asked questions that can expand directly in search results
- Product: For e-commerce, including price, availability, and reviews
- LocalBusiness: For businesses with physical locations
Build a Blade component that accepts structured data as an array and renders it as JSON-LD. This keeps your templates clean and makes it easy to add structured data to any page.
Performance Optimization
Server-Side Caching
Laravel provides multiple caching layers that directly impact page speed and, consequently, SEO performance:
- Route caching: Run php artisan route:cache in production to serialize your route definitions. This can reduce route registration time by up to 50 percent on applications with many routes.
- Config caching: Run php artisan config:cache to combine all configuration files into a single cached file, eliminating filesystem reads on every request.
- View caching: Run php artisan view:cache to precompile all Blade templates so they don't need to be compiled on first request.
- Query result caching: Cache expensive Eloquent queries using Laravel's cache system. For content that changes infrequently, such as blog posts or static pages, cache the query results for minutes or hours rather than hitting the database on every request.
Response Optimization
Enable Gzip or Brotli compression at the web server level to reduce the size of HTML, CSS, and JavaScript responses. Configure proper cache-control headers for static assets. Set long cache lifetimes for versioned assets (which Vite handles via content hashing) and shorter lifetimes for HTML pages.
Database Performance
Use eager loading to prevent N+1 query problems. On a blog index page that shows posts with their authors, a query like BlogPost::with('author')->published()->get() executes two queries regardless of how many posts are returned. Without eager loading, the same page would execute one query per post plus one for the list, turning into dozens of queries.
Robots.txt and Crawl Management
Your robots.txt file controls which parts of your site search engines can crawl. In Laravel, serve it as a static file from the public directory or generate it dynamically through a route. At minimum, it should reference your sitemap and block access to administrative routes, API endpoints, and other pages that shouldn't appear in search results.
Be careful not to accidentally block important content. A common mistake is blocking entire directories that contain both admin pages and public-facing resources. Use specific path rules rather than broad directory blocks.
HTTPS and Security Headers
HTTPS is a confirmed ranking signal. Ensure your Laravel application forces HTTPS in production by setting APP_URL to an https:// URL, using the url()->forceScheme('https') method in a service provider, or configuring your web server to redirect all HTTP traffic to HTTPS.
Additionally, implement security headers that also benefit SEO trust signals: Strict-Transport-Security, Content-Security-Policy, X-Content-Type-Options, and Referrer-Policy. These can be added through Laravel middleware.
Monitoring and Ongoing Maintenance
Technical SEO is not a one-time implementation. Set up monitoring to catch issues before they impact rankings:
- Register your site with Google Search Console and review the Core Web Vitals and Coverage reports weekly
- Run automated Lighthouse audits as part of your CI/CD pipeline to catch performance regressions before they reach production
- Monitor for broken links and crawl errors using tools like Screaming Frog or Ahrefs
- Review your structured data validity using Google's Rich Results Test after any template changes
Start With the Fundamentals
If your Laravel application currently has no SEO implementation, start with the highest-impact items: unique title tags and meta descriptions on every page, an XML sitemap submitted to Google, canonical URLs, and server-side caching. These four elements alone will establish a solid SEO foundation.
At Forth Media, we build Laravel applications with technical SEO baked into the architecture from the start. If your application needs an SEO audit or implementation, we'd love to help you climb the rankings.