Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
When ' or & are used in meta descriptions, they are converted into ' and & This HTML then displays in summaries in Google where they look bad. & and ' are both valid characters for meta descriptions, so Metatag should not convert them into HTML entities.
Sorry if this is a duplicate. I couldn't find another issue in the queue about this.
Comment | File | Size | Author |
---|---|---|---|
#3 | metatag-n2166109-3.patch | 4.38 KB | DamienMcKenna |
Comments
Comment #1
Greg BoggsComment #2
DamienMcKennaI've tracked the problem down to the theming functions, and ultimately theme_html_tag is to blame.
Comment #3
DamienMcKennaOk, this solves the problem, but it adds a requirement for all custom theming functions that they also fix the output (note added to README.txt about it).
Comment #4
Greg BoggsWow that was fast! I just explained that we should wait 3-4 weeks for a patch. I'll test this first thing in the morning. Thank you!
Comment #5
Greg BoggsWell this is embarrassing. It appears I may have wasted your time with this report. It appears Meta descriptions are supposed to be HTML encoded now to be valid HTML.
Search Engines display them correctly as text in search results.
I didn't research this extremely well, but I did find this:
http://stackoverflow.com/questions/3311705/should-meta-tags-be-html-encoded
and
http://www.datadial.net/blog/index.php/2011/04/13/special-characters-in-...
Comment #6
DamienMcKennaI thought so, but it was an excuse for me to dig into the codebase to remind myself how the output worked.