I would a suggestion:
we have a main domain and several subdomains where for some of them the pages are a duplicate of the pages in the main domain.
I need to insert a canonical link in the <head> tag of each page .
How can I do it?
I have found some plugins but they insert the canonical link globally but in my case not always there is an exact correspondence between the url page of main domain and the url page of subdomain
Hope you can help me