DEV Community

Ben Greenberg
Ben Greenberg

Posted on

Quick tip: canonical URLs prevent silent SEO damage

Quick tip on SEO:

If your site is accessible at both https://example.com and https://www.example.com, Google sees two different sites and splits your ranking signals between them.

Fix: add a canonical tag to every page:

<link rel="canonical" href="https://example.com/page" />
Enter fullscreen mode Exit fullscreen mode

Check if yours is set correctly — the free audit tool at https://audit.hummusonrails.com/free checks canonical tags along with 4 other key issues.

Top comments (1)

Collapse
 
apogeewatcher profile image
Apogee Watcher

Good reminder. One thing I’d add: canonical tags help, but they should usually sit behind the more basic controls too.

If both hostname variants are live, I’d still want a consistent internal linking pattern, a preferred sitemap URL format, and server-side redirects where possible. Otherwise teams end up treating canonicals as a patch for an environment/configuration problem.

The other operational issue is drift. Canonicals are easy to get right once and wrong later after a CMS change, plugin update, or template edit. That is why checking them continuously across key page groups tends to catch issues earlier than waiting for a traffic drop.