Small SEO Tools

How to Keep Organization Names Intact in JSON-LD

A JSON-LD block can be valid JSON while carrying a different organization name from the one you intended. This happens when an HTML-encoded value is copied into a JSON string. The useful check is to compare the parsed value with the original name, rather than stop at a green syntax message.

For this example, the fictional business is Fern & Fig Studio. Its name contains one ampersand. Google recommends keeping an organization name consistent with the site name in its Organization structured data documentation. The examples below check the data you supply; they do not predict a particular search appearance.

Identify the value that changed

Suppose a template copies this value from a field that was already encoded for HTML:

{
  "@context": "https://schema.org",
  "@type": "Organization",
  "name": "Fern & Fig Studio",
  "url": "https://fern-fig.example/"
}

In ordinary HTML text, & is a character reference. Inside the JSON string above, the ordinary JSON parser reads those five characters literally. Parsing succeeds, but the resulting name is Fern & Fig Studio, which differs from our original business name.

The JSON-LD specification discussion of embedded scripts also notes that HTML-escaped content remains escaped through the JSON-LD API. Keep the intended string and the HTML presentation of that string separate.

Check syntax and the parsed name separately

  1. Copy only the JSON inside the relevant JSON-LD script, without the opening and closing script tags.
  2. Paste it into the JSON Formatter. Select two-space indentation and leave Minify and Sort keys off.
  3. Choose Format JSON, then read the name value in the output.

With the example above, the current formatter accepts the JSON and preserves the entity spelling. It formats parsed JSON; it does not decide whether a name matches a business or validate Organization properties. MDN documents JSON.parse() as parsing JSON text into a JavaScript value.

These four inputs illustrate the difference. The middle column is the exact name value obtained with JSON.parse(), without an extra HTML-decoding step.

Name text inside JSON quotes Parsed name Matches our original?
Fern & Fig Studio Fern & Fig Studio No
Fern & Fig Studio Fern & Fig Studio No
Fern & Fig Studio Fern & Fig Studio Yes
Fern \u0026 Fig Studio Fern & Fig Studio Yes

A backslash followed by u0026 is a JSON Unicode escape for the ampersand. RFC 8259 on JSON strings defines this escape form. The formatter can rewrite that spelling as a literal ampersand while preserving the parsed value.

Correct the source field before serialization

In the existing plugin or template responsible for Organization data, supply the original name as plain text and let its JSON serializer handle JSON quoting and escaping. For this fictional example, the intended JSON value is:

"name": "Fern & Fig Studio"

Check where the encoded version first appears: the stored setting, an intermediate HTML display value, or the template output. Fix that step. Avoid decoding an entire JSON document as HTML: converting entity spellings into quotation marks or other characters can change data or break JSON syntax. Also preserve an entity-like sequence if it is genuinely part of the original name.

Update the existing schema provider rather than adding a second Organization block to override it. An ampersand check alone does not cover every HTML embedding concern. If values contain a closing script sequence, follow the separate guide to keeping JSON data inside its script block.

Verify the saved page, not only a settings preview

After saving, open the public page source and find the relevant Organization node. Repeat the syntax and name comparison on that output. A preview can be correct while a later template step still encodes the value.

For a small local HTML fixture, this corrected block and console check make the round trip explicit:

<script id="organization-data" type="application/ld+json">
{"@context":"https://schema.org","@type":"Organization","name":"Fern & Fig Studio","url":"https://fern-fig.example/"}
</script>
const element = document.querySelector('#organization-data');
const data = JSON.parse(element.textContent);
console.log(data.name === 'Fern & Fig Studio');
// true

The selector belongs to this fixture; use the appropriate node when inspecting a real site, where data may be nested in @graph. In our local browser checks, reading script text and parsing it preserved the two entity spellings literally, while the raw ampersand and JSON Unicode escape recovered the intended name. These are browser extraction and JSON parsing results, without a search engine parser or rich-result test.