When using a a remote image for open graph image (og:image), metatag is output 3 times, twice incorrectly if using query string
e.g. add this to open graph image tag
https://i0.wp.com/www.brixtonbuzz.com/wp-content/uploads/2024/05/streath...
and compare to
https://i0.wp.com/www.brixtonbuzz.com/wp-content/uploads/2024/05/streath...
| Comment | File | Size | Author |
|---|---|---|---|
| #3 | Screenshot 2025-10-10 at 15.29.53.png | 165.08 KB | 2dareis2do |
| #3 | Screenshot 2025-10-10 at 15.16.05.png | 127.19 KB | 2dareis2do |
| Screenshot 2024-05-24 at 18.26.44.png | 123.68 KB | 2dareis2do |
Comments
Comment #2
mrcdrx commentedI can confirm this issue.
Comment #3
2dareis2do commentedNot sure if I have found a new bug or if this is related to this one but I also discovered that the use of delimiters in alt tags breaks the meta tag output for images.
In MetaManager->processTagValue() we have the following
This looks like it is using a comma for a delimiter.
In my meta image I had alt tag defined. I had used 2 commas!
e.g.
Removing the use of commas in the alt tag field seems to resolve the issue with og:image being added multiple times. So with an image the site url is also appended. This appears to be repeated depending on how many delimiters you have.
Interestingly the first part of the alt text seems to be ignored but the following delimited strings are prepended.
So to summarise, strings with delimiters appear to be break the token replacement and the number of items returned.
This seems like a potential bug as commas appear to be allowed when entering a string in Drupal?
One solution might be too disable the use of certain delimiters when entering a string in Drupal.
Not sure what the query string issue is exactly but perhaps there is some other character being used as a delimiter when processing tag values?
Might be good to add a test for this scenario.
Comment #4
2dareis2do commentedLooks like a known bug when using commas as delimiters
https://www.drupal.org/project/metatag/issues/2761909
Comment #5
damienmckennaLet's add some test coverage.
Comment #6
justinchev commentedThis token seemed to work for me in order to only render the image url without the alt text and the problem commas.
[node:field_image:entity:url]