# A document must not include more than one “meta” element with a “http-equiv” attribute whose value is “content-type”.

> Canonical HTML version: https://rocketvalidator.com/html-validation/a-document-must-not-include-more-than-one-meta-element-with-a-http-equiv-attribute-whose-value-is-content-type
> Attribution: Rocket Validator (https://rocketvalidator.com)
> License: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/)

A document can have only one `meta` element with `http-equiv="content-type"`, so keep a single encoding declaration and delete the rest.

`<meta http-equiv="content-type" content="text/html; charset=utf-8">` is the older way to declare a page's character encoding. HTML treats it as an encoding declaration, just like `<meta charset="utf-8">`, and a document may contain only one. The validator reports an error for every extra copy, even when all of them say `utf-8`. It also ignores case in the `http-equiv` value, so `Content-Type` and `content-type` count as the same declaration.

Duplicates usually come from templates. A base layout writes the declaration, then a partial or a plugin adds it again further down the `head`. Find every copy in the rendered page, keep the first one and delete the others.

You can also swap the one you keep for the shorter `<meta charset="utf-8">` and put it first in the `head`, so it sits within the first 1024 bytes of the document. Don't keep both forms, though: the validator rejects a `meta charset` next to a `meta http-equiv="content-type"` with a different error.

## Invalid example

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  <title>Products</title>
  <meta http-equiv="content-type" content="text/html; charset=utf-8">
</head>
<body>
  <p>Hello</p>
</body>
</html>
```

## Valid example

```html
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="utf-8">
  <title>Products</title>
</head>
<body>
  <p>Hello</p>
</body>
</html>
```
