I have a page located at
example.com/tagged, which shows posts that contain the selected tag for which a person has searched.
So, if someone searched for
example.com/tagged/apple would show all posts tagged with the
#apple hashtag, and
example.com/tagged/orange would show all posts tagged with the
#orange tag. Simple enough.
Now, Google is telling me it needs a canonical URL. In my code, do I just add the canonical tag for each hashtag?
Meaning, should the canonical tag be dynamic, so that when someone searches for
#apple the tag is
<link rel="canonical" href="https://example.com/tagged/apple" />
and when someone searches for
<link rel="canonical" href="https://example.com/tagged/orange" />
Is this how it works?