{
  "id": 17846713,
  "title": "Your Next.js Site Has Four Copies of Every Page. Here Is How to Tell Google Which One Counts",
  "url": "https://urgent.news/2026/11/02/your-next-js-site-has-four-copies-of-every-page-here-is-how-to-tell",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-11-02T19:58:20.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/levelupdmg/your-nextjs-site-has-four-copies-of-every-page-here-is-how-to-tell-google-which-one-counts-7km"
  },
  "original_language": "en",
  "account": "Next.js sites on Vercel often have duplicate pages due to default configurations that create multiple URLs for the same page. This can dilute a page's ranking by spreading it across different addresses. To consolidate the authority on a single URL, follow these four steps.\n\nFirst, choose a single host and scheme. Either use the apex domain (example.com) or the www subdomain (www.example.com), and redirect the other version to the chosen one using a permanent redirect in Vercel's Domains settings or middleware. This helps avoid duplicate content caused by having both versions indexed.\n\nSecond, decide on a trailing slash policy and let Next.js handle the redirects. Set trailingSlash: false in next.config.js to redirect requests without a trailing slash to the version with the trailing slash. This ensures that all URLs for the same page have a consistent format, reducing duplicate content.\n\nThird, add a canonical tag to each page, pointing to the clean URL without query strings. In the App Router, define the metadata base in app/layout.tsx and set the canonical tag for each page using the slug from the page's data. This signals to Google which URL is the preferred version, especially when dealing with query strings that can't be redirected without breaking attribution.\n\nFinally, exclude preview deployments from being indexed by adding a robots.txt file that includes a noindex directive for environments other than production. This prevents preview domains, custom staging sites, and branch URLs from competing with the live version, keeping the crawl budget focused on the main site. By implementing these four decisions, you can consolidate your Next.js site's pages, improve search rankings, and prevent duplicate content issues.",
  "summary": "You ship one page. Google can crawl it at four or five different URLs, and it treats every one of them as a separate document until you say otherwise. On a Next.js site deployed to Vercel, most of those duplicates are created by defaults you never chose, and they quietly split your rankings across addresses that should have been one. This is the cleanup pass I do on every service business site…",
  "key_points": [
    "Choose a single host and scheme for the site",
    "Set trailingSlash: false in next.config.js",
    "Add canonical tags to each page"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}