DrivenHost

Blog / seo wednesday

Fixing Duplicate URLs on a WordPress Site

WordPress can serve one page at half a dozen addresses. Here is how we sort out duplicate URLs, canonical tags and redirects properly.

One page, several addresses. That is the default state of a WordPress site nobody has checked, and it sits behind a complaint we hear most weeks: Google is showing the wrong version of my best page. Nothing looks broken. Every URL loads fine. Search engines just have to decide which one counts, and they do not always pick the one you would have picked.

This week's SEO note is about tidying that up. It takes an afternoon, costs nothing, and then applies to every page you publish afterward.

Where the extra copies come from

Most duplicates are structural rather than editorial. A single article can be reachable at all of these at once:

  • http:// and https://
  • with and without www
  • with and without a trailing slash
  • with tracking parameters attached (?utm_source=newsletter)
  • through a parked or add-on domain pointing at the same document root

We see that last one constantly. Someone registers a second domain for a campaign, points it at the same folder, and now the whole site exists twice. To a crawler those are two sites with identical content, and neither gets full credit for the other's links.

Fix it at the server, not in a plugin

Settle on one form (we suggest https, one www choice, kept forever) and enforce it low in the stack where it is cheap.

In cPanel, the Domains area handles forcing HTTPS, and the Redirects tool writes the www rule into .htaccess for you. A canonical redirect should be a 301, it should happen in one hop, and it should land on the final URL directly. Two-hop chains still work, they just waste a round trip on every visit and every crawl. If your .htaccess has grown layers over the years, our notes on getting redirects right cover the hop-counting side of it.

Then make WordPress agree with the server. Settings, then General, has WordPress Address and Site Address. If those still say http:// or disagree with your redirect, WordPress keeps printing links to the version you are redirecting away from, so every internal link becomes a two-hop trip.

What a canonical tag actually does

The rel="canonical" tag is a hint, not an order. You are stating which address you consider the real one. Search engines weigh it against your internal links, your sitemap and your redirects, and when those disagree with the tag, the tag can lose.

So treat it as the last step rather than the fix. Get redirects and internal links pointing the same way, then let your SEO plugin output the canonical. The mainstream plugins handle this correctly with default settings. The broken canonicals we run into almost always come from someone hand-editing one into a theme template years ago, where it now points at a page that no longer exists. Worth a look in your header template if your canonicals read oddly.

The WordPress-specific offenders

Past protocol and hostname, a stock install manufactures thin near-duplicates on its own.

Tag and category archives holding a single post. If the archive text says the same thing as the post, it competes with the post for the same query. Prune tags you only ever used once.

Attachment pages. Every uploaded image can get a URL of its own with no real content on it. Most SEO plugins have a switch to redirect attachment pages to the parent post, and it belongs on.

Comment pagination and ?replytocom links, which multiply quickly under a popular post.

Internal search result pages, which should never be indexed at all.

None of this sinks a site. It spreads crawl attention thinly, which on a small site is the budget that genuinely matters, and now and then one of these surfaces instead of the page you wanted.

Check your work

Two checks, five minutes each.

Search for site:yourdomain.com and read the addresses rather than the titles. Both www and non-www showing up, or any http, means your redirect is not doing its job.

Then open Search Console, run URL Inspection on three or four pages you care about, and compare "User-declared canonical" with "Google-selected canonical". Matching means you are finished. A mismatch means Google found a reason to prefer a different address, and nine times out of ten that reason is an internal link or a sitemap entry nobody updated. What the surrounding statuses mean is covered in our walkthrough of the indexing report.

If you are not sure which redirects are already live on your account, or your .htaccess has sediment from three rebuilds ago, send us the domain and we will read it with you. Our support team works on the servers your site actually runs on, so we can tell you what is firing instead of guessing from the outside.

seo wednesdayduplicate contentcanonical urls

← All posts

No sales team. No scripts.

Tell us what you're running.
We'll tell you what it needs.

Migrations are free, quotes are written, and the engineer who replies is on the team that will run your server.