In the editor, the page’s short description (meta description) looks like “Delivery & payment,” while the HTML after the browser processes it—the DOM—shows an & sign. This may be correct HTML encoding. Escaping replaces special characters with safe representations for HTML. The problem occurs when text is escaped again or system text ends up in the description. Compare the CMS field, the HTML source, and the string the browser received. Then read the description itself: even correctly encoded system text should be replaced.
What the browser receives after parsing HTML
HTML can represent special characters using codes, for example & instead of an ampersand &. When reading the page, the browser converts the code back into a character. Official documentation.
In HTML, & may be a valid representation of a single ampersand. After parsing the attribute, the browser gets the corresponding character. So the presence of an entity in the source should not automatically be flagged as a defect. Compare two levels: the response text and the parsed meta content value. If the source contains &, the result may retain the literal &. That is a different situation. The description must also be assessed for meaning: even a correctly encoded phrase like “Fill in this field” is still system text, not a useful description of the page.
One ampersand and double escaping
| Description entry | Why the code is visible | What to fix | Expected text |
|---|---|---|---|
& in the source | Escaped once | Check the DOM | A regular & character |
& in the source | Double escaped | Check the generator | No literal & |
| Add a description | Editor placeholder | Remove it from the data | Editorial text |
| Quotation marks in the description | Special characters | Check the attribute | HTML is not broken |
Read the content value
Find all meta[name="description"] elements in the response source and the DOM. Get getAttribute("content") and compare it with the expected plain text. If multiple elements return different descriptions, first resolve the competing source. Don’t rely on what appears in the search result description: the search engine may have selected page text or used an older version. Record the URL, CMS field, source content, and the result of the command below. For pages in different languages, check whether the description is coming from another locale. A template issue may coincide with a data issue, so investigate the causes separately.
Read the description in the browser console after HTML processing:
[...document.querySelectorAll('meta[name="description"]')].map(el => el.getAttribute("content"));For the source content="Доставка & оплата", the expected string is Доставка & оплата. With &, the browser will retain the literal &. Compare this with the CMS field: plain text should be escaped once when rendered.
Check one test record
Prepare a description on a test record: “Delivery & payment: terms for model A.” Save it as plain text, then inspect the HTML source and the DOM. If testing an import, repeat the check with an input value that has already been encoded intentionally. The result should remain readable, while the HTML should be formed safely. Don’t run this test by globally decoding published pages. A single record lets you trace how the text changes from import to HTML without risking the entire catalog. If quotation marks are used, make sure they don’t close the attribute prematurely or create an unintended HTML element.
Fix repeated encoding at the source
Find the code that turns & into &. Often, the import stores entities in advance, and the template then correctly escapes the entire text again. Configure the import to store plain text. Let the template encode it once when rendering the HTML. The specific mechanism depends on the CMS in use. Don’t disable safe escaping throughout the template just to fix one description. If you need to restore values that were imported earlier, make a limited list and check that actual characters are preserved. Quotation marks and special characters still need to be encoded when rendered: this protects the structure of the HTML attribute.
Save the description and read it again
A description with an ampersand and quotation marks remains readable in the DOM, and the HTML attribute is not broken. “Add a description” has been replaced with text about the page. Reimporting does not bring back double escaping; safe template output is preserved.
Read also: Meta Description: how to write a description that increases CTR and HTML validation: why check code and how to fix errors. Website checks are available on the reChecker technical audit page.