How to fix “Duplicate without user-selected canonical” on Laravel
If Search Console shows “Duplicate without user-selected canonical” on your Laravel site, you are in the right place. Google found duplicates of the content and you did not declare a canonical. This page covers the causes and a step-by-step fix for Laravel. A PHP framework. SEO behaviour is entirely in your code; meta tags live in Blade templates and the sitemap comes from a package or a custom command.
Contents
What does this status mean?
The same or very similar content sits on several URLs and none of them has a canonical pointing at your preferred one. Google then decides which one goes in the index.
Likely causes on Laravel
- The www and non-www, http and https versions all open.
- Parametrised URLs (sorting, tracking, session) repeat the same page.
- The same product or post is reachable through several category paths.
- Addresses with and without a trailing slash behave as separate pages.
- Laravel note: Output a canonical in the layout with url()->current() and leave query parameters out. For pagination, each page should carry its own canonical.
Step-by-step fix on Laravel
- In your Laravel admin go to: The Blade layout (head section), public/robots.txt, routes/web.php and the sitemap package configuration.
- Output a canonical in the layout with url()->current() and leave query parameters out. For pagination, each page should carry its own canonical.
- Add a rel=canonical pointing at your preferred absolute address to every page.
- Redirect domain versions (http/https, www) to a single one with 301.
- Make sure internal links and the sitemap always use the canonical address.
- Strip needless parameters from internal links or canonicalise them to the clean address.
- After fixing, start validation in Search Console and send the canonical URL for indexing.
Extra checks for Laravel
- sitemap: Generate the sitemap with a package such as spatie/laravel-sitemap or a custom Artisan command and refresh it with a scheduled task. Include only published, canonical URLs.
- speed and crawling: Cache routes, config and views in production (artisan optimize), cut database queries with eager loading and use OPcache.
After fixing
In Search Console start "Validate fix" for this status and resubmit the page with URL inspection. First confirm the blocker is gone with the free Free indexability checker tool; for many URLs follow Bulk URL indexing: how to send thousands of pages to Google. Google makes the indexing decision itself and timing ranges from days to weeks.
More information
Frequently asked questions
Do duplicate pages get my site penalised?
Usually not, but signals get split and an unwanted URL can end up indexed. A canonical gathers them.
Is canonical a directive?
No, it is a strong hint. Google may choose another URL if other signals contradict it.
Where are these settings on Laravel?
The Blade layout (head section), public/robots.txt, routes/web.php and the sitemap package configuration.
Related pages
- Laravel: Duplicate, Google chose different canonical than userFixes
- Laravel: Alternate page with proper canonical tagFixes
- Laravel: Page with redirectFixes
- Ghost: Duplicate without user-selected canonicalFixes
- WordPress: Duplicate without user-selected canonicalFixes
- WooCommerce: Duplicate without user-selected canonicalFixes