Setting custom canonical urls
I have a page that requests and displays information from a database. All is fine but I'm having some trouble setting custom canonical URLs for this single page only and its URLs (with parameters inside).
Example:
https://example.com/primary-page
https://example.com/primary-page?requested_id=1
https://example.com/primary-page?requested_id=2
https://example.com/primary-page?requested_id=3 and so on...
These links with "?requested_id=id" automatically inherit the same canonical link as the "primary-page". Which I would like to modify in order for these links to have their own and full URLs as canonical link.
I've been looking for a solution for a few days now without luck. I hope one of you will be able to help me, which I do not doubt at all.
So, thank you so much in advance!
Topic rel-canonical functions php customization Wordpress
Category Web