Small SEO Tools

Why a Pasted URL Changes Inside HTML Text

A URL can look correct in HTML source but display a copyright symbol on the page. The visible link text and its destination can even disagree. Check whether an ampersand in the URL has been interpreted as the start of an HTML character reference.

Reproduce a changed link label

This fictional address contains two query parameters, q and copy.

https://example.test/?q=tea&copy=1

Suppose a template inserts that original address directly into both parts of a link. The following is the resulting HTML source.

<a href="https://example.test/?q=tea&copy=1">https://example.test/?q=tea&copy=1</a>

In a browser HTML parser, its visible text becomes https://example.test/?q=tea©=1. The quoted href attribute retains the original address in this example. Inspecting only the destination would miss the damaged label.

Understand the text and attribute difference

HTML recognizes some historical named references without a final semicolon. The name copy is one of them and represents ©. In the link text, the parser consumes &copy from the address as that reference. HTML named character references

Attribute parsing has an exception when a matched name lacks a semicolon and the next character is an equals sign or an ASCII letter or digit. That exception preserves &copy=1 in this quoted attribute. A missing semicolon therefore does not make the same sequence behave identically in both places. HTML character-reference parsing rules

Encode the original address for HTML source

  1. Open the HTML Encoder and Decoder and choose Encode special characters only.
  2. Paste the original address into Input and press Convert.
  3. Confirm that the output has one &amp; reference in place of the original ampersand.

For this example, the tool produces the following text.

https://example.test/?q=tea&amp;copy=1

Use that HTML representation when emitting this fixed address into the link source.

<a href="https://example.test/?q=tea&amp;copy=1">https://example.test/?q=tea&amp;copy=1</a>

After HTML parsing, both the visible text and the quoted attribute recover the original address. The &amp; reference represents an ordinary ampersand. Keep the original URL in your source data and let the template’s HTML escaping handle it once when available. HTML character-reference forms

Verify the rendered text as well as the target

On the actual rendered page, compare the complete label with the original address and inspect the link’s href attribute. Repeat the check after any template or editor processing. This example uses a fictional host to test parsing, so it does not require opening the destination.

The on-site decoder is a separate text converter. If you choose Decode entities back to text and enter the original semicolonless address, it leaves it unchanged and shows zero entities decoded. Its decoder requires a terminating semicolon. That result cannot establish how a browser will parse the address inside HTML.

The plain-text entity decoding guide explains that converter’s table and counts. Use an actual HTML preview for the text-versus-attribute case demonstrated here.