How to change the <link rel="prev"> element on page 2 of a collection?

Topic summary

A user is attempting to modify the <link rel="prev"> element on page 2 of Shopify collection pages. Currently, the element outputs /collections/men?page=1, but they want it to display /collections/men instead (removing the ?page=1 parameter).

They have successfully modified the visible pagination <a> links but cannot locate where to change the <link> element in the theme code.

The question remains unanswered—they are seeking guidance on how to override or customize this specific <link rel="prev"> output in their Shopify theme.

Summarized with AI on October 27. AI used: claude-sonnet-4-5-20250929.

We want to modify the <link rel="prev"> element on page 2 of our collection pages.

For example, if the collection URL is /collections/men, then on page 2 the current output is:
<link rel="prev" href="/collections/men?page=1">

We’d like to change it to:
<link rel="prev" href="/collections/men">

We were able to adjust the <a> pagination link (not live yet), but we can’t find where to update the <link> element itself.

Is there any way to modify or override this <link rel="prev"> output?

<link rel="prev"> and <link rel="next"> tag in Shopify is not theme-controlled. it is generated automatically by Shopify’s core platform, not by your Liquid templates.

Google and other crawlers already interpret /collections/men?page=1 and /collections/men as equivalent. So you don’t need to change it, Shopify’s structure is already SEO safe.