Should you have (the same) language neutral content in modern Drupal available under several URL prefixes, this will probably be considered duplicate content.
Example:
- https://www.example.com/forum/abc/my-custom-topic
- https://www.example.com/en/forum/abc/my-custom-topic
- https://www.example.com/es/forum/abc/my-custom-topic
all serving the exactly same node (because the node type is configured language neutral)
For user-generated content like a forum in a multilanguage project, this may make sense in some cases. (Typically it's of course best to use real languages where possible)
To not have this considered as duplicate content, Metatag module and canonical metatag come to the rescue!
For the affected content type create a default metatag overriding the "canonical" meta-tag otherwise generated automatically and set it like this:
canonical_url: [node:source:url:absolute]
This will use the original URL of the source language as canonical and tell the search engine that that's the right path to look for.
Update:
Later I saw that this won't work (at least as of 2024-06) because the source is language neutral
As a workaround, you need to build the full URLs you're expecting manually, for example:
canonical_url: [site:base-url][node:source:url:path]
[site:base-url]/node/[node:nid]
Mind to include the language prefix of your fallback language, if needed. In our case, the fallback language had no language prefix!