Skip to content

Google not indexing pages due to "Duplicate without user-selected canonical" issue #80868

@jperezr21

Description

@jperezr21

Link to the code that reproduces this issue

https://github.com/jperezr21/static-and-dynamic-metadata

To Reproduce

  1. Create dynamic path with async generateMetadata that sets alternates.canonical to the path without any query params (let's say /[storeHandle]/[productSlug]).
  2. Have a selectable property that's reflected in the URL query params (eg: ?variant=[variantName])
  3. Have other pages link to the page with the query params (eg: link to specific product variants).
  4. Google will say there's no user-selected canonical for these pages even though it is (the problem is that the canonical tag is being streamed and it's not present in the initial HTML).

Image

Image

Current vs. Expected behavior

  • Current: Google is not detecting user-selected canonical for streamed pages
  • Expected: Have the ability for defining both static and dynamic metadata. I want to have the canonical as static, but the rest (product title, description, images, etc) dynamic. This isn't supported at the moment (from the docs):

You cannot export both the metadata object and generateMetadata function from the same route segment.

Provide environment information

Operating System:
  Platform: darwin
  Arch: arm64
  Version: Darwin Kernel Version 24.5.0: Tue Apr 22 19:54:29 PDT 2025; root:xnu-11417.121.6~2/RELEASE_ARM64_T6030
  Available memory (MB): 18432
  Available CPU cores: 11
Binaries:
  Node: 22.13.1
  npm: 11.1.0
  Yarn: N/A
  pnpm: 10.12.1
Relevant Packages:
  next: 15.3.4 // Latest available version is detected (15.3.4).
  eslint-config-next: N/A
  react: 19.1.0
  react-dom: 19.1.0
  typescript: N/A
Next.js Config:
  output: N/A

Which area(s) are affected? (Select all that apply)

Metadata

Which stage(s) are affected? (Select all that apply)

Vercel (Deployed)

Additional context

No response

NEXT-4690

Metadata

Metadata

Assignees

No one assigned

    Labels

    MetadataRelated to Next.js' Metadata API.linear: nextConfirmed issue that is tracked by the Next.js team.

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions