Site icon Hip-Hop Website Design and Development

All paginated contents use the same canonical URL

I use pagination to split large table into many pages. However, it seems that all pages will use the same canonical URL which refers to the first page.

For example, in https://www.datanumen.com/access-repair/errors/access-2013-complete-error-list/76/, its canonical URL will be:

<link rel="canonical" href="https://www.datanumen.com/access-repair/errors/access-2013-complete-error-list/" />

How to fix this issue? I see there is a function rel_canonical() which may be related to canonical URL. But it does not provide any information on paginated contents.

Update

Before posting, I make a test on a standard theme "Twenty Twenty One", and find the theme will set different canonical URL for different pages. For example, for page https://www.datanumen.com/license/2021/11/21/test-pagination/2/, its canonical URL is:

<link rel="canonical" href="https://www.datanumen.com/license/2021/11/21/test-pagination/2/" />

Thus I believe that the correct way to set each page canonical URL to its own URL instead of the first page URL.