Canonical URLs for Lovable

Lovable canonical URLs: prevent duplicate indexing

Add correct canonical URLs to Lovable pages so search engines understand the preferred production URL and avoid duplicate indexing.

Direct answer

A canonical URL tells search engines which URL is the preferred version of a page. On a Lovable site, every indexable route should normally emit a self-referencing canonical using the final production domain. Preview domains, tracking parameters and alternate URL variants should not become the canonical by accident.

Key takeaways

  • Use the final HTTPS production hostname.
  • Use one canonical per indexable page.
  • Keep canonical URL format consistent with redirects and internal links.
  • Do not canonicalize unrelated pages to the homepage.
  • Test the rendered HTML on the deployed site.

The most dangerous canonical mistake

A site-wide canonical copied from the homepage can tell search engines that every route is a duplicate of one URL. Canonicals should reflect the preferred version of each page, usually the page itself unless there is a deliberate consolidation strategy.

Production domains versus previews

Builder previews are useful for development but should not leak into production canonical tags. Generate canonicals from a controlled site URL or production configuration rather than from an arbitrary request hostname when that can include previews.

Canonical signals should agree

Internal links, redirects, sitemap URLs and canonical tags should point toward the same preferred URL format. Contradictory signals create unnecessary ambiguity and make debugging indexing harder.

Frequently asked questions

Should a canonical be self-referencing?

For most unique indexable pages, yes. A self-referencing canonical clearly identifies the preferred version of that URL.

Does canonical mean redirect?

No. A canonical is a search signal; it does not send the visitor to another URL. Use an HTTP redirect when users and crawlers should actually move to the preferred URL.

Can two pages share a canonical?

They can when they are genuinely duplicate or near-duplicate representations and one version should be preferred, but this should be intentional.