Skip to content

Feature to Add <link rel="next/prev" href="..." > in head. #52923

Discussion options

You must be logged in to vote

I've just found out there is a workaround which consist in injecting custom <link /> tags using the icons object in the Metadata API

export const metadata: Metadata = {
  title: 'example.com,
  description: "The Galaxy's Best Coffee",
  icons: {
    other: [
     { rel: 'next', url: 'https://example.com/search?page=3' },
     { rel: 'prev', url: 'https://example.com/search?page=1' },
    ]
  }
}

I've just inserted this on my website and seems to work correctly.
This is the output

<link rel="next" href="https://example.com/search?page=3">
<link rel="prev" href="https://example.com/search?page=1">

Replies: 4 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@insanity54
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
2 replies
@kirstymullen
Comment options

@ung0v
Comment options

Answer selected by umang-goyal
Comment options

You must be logged in to vote
3 replies
@mediabeastnz
Comment options

@kirstymullen
Comment options

@Saul-BT
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
7 participants