Skip to content
Every tutorial here is 100% free — and always will be
LSLovableStudent

How do I add canonical URLs?

Last checked 31 Aug 2026

Short answer

Ask Lovable to add a <link rel="canonical"> tag to each page pointing to its preferred URL — this tells search engines which version to index when the same content is reachable at more than one address.

Why canonical tags matter

If the same content is reachable at more than one URL — https://yourdomain.com/pricing and https://yourdomain.com/pricing/, or with and without tracking parameters — search engines may treat them as duplicate content and dilute ranking signals across both. A canonical tag tells them which URL is the "real" one to index.

How to add one

Add a canonical link tag to each page's head pointing to its own clean URL, e.g. https://yourdomain.com/pricing without trailing slashes or query parameters.

Markup looks like:

<link rel="canonical" href="https://yourdomain.com/pricing" />

On a multi-route app, this needs to be set per page (each page's canonical points to itself, generally), not one static tag shared across the whole site.

Common situations that need canonicals

  • Content reachable both with and without www.
  • URLs with tracking parameters (?utm_source=...) that are functionally the same page.
  • A product or listing page reachable via more than one category path.

What usually goes wrong

  • A single hardcoded canonical URL copy-pasted onto every page (usually the homepage's) — this tells Google every page is actually the homepage, which is worse than having no canonical tags at all. Each page's canonical should point to itself unless you're deliberately consolidating duplicate content.
  • Canonical pointing to http:// when the site is served over https://.
  • Forgetting canonicals entirely when running the same content on both a custom domain and the lovable.app subdomain — pick one as canonical to avoid duplicate-content dilution.

Sources

Was this answer helpful?

Related questions

Website made, maintained and hosted by PromptSites.com

PromptSites logo