Guías HTML para meta
Aprende a identificar y corregir errores comunes de validación HTML marcados por el W3C Validator, para que tus páginas cumplan con los estándares y se muestren correctamente en todos los navegadores. También consulta nuestras Guías de accesibilidad.
In older HTML specifications (HTML 4.01), the scheme attribute was used to provide additional context for interpreting the content value of a <meta> element. It told browsers or metadata processors which encoding scheme, format, or vocabulary applied to the metadata. For example, you could specify that a date followed the W3CDTF format or that a subject classification used a particular taxonomy.
HTML5 dropped the scheme attribute because it was rarely used by browsers and its purpose was better served by making the scheme part of the metadata value itself. The WHATWG HTML living standard does not recognize scheme as a valid attribute on <meta>, so including it will produce a validation error. Keeping obsolete attributes in your markup can cause confusion for developers maintaining the code and signals outdated practices that may accompany other compatibility issues.
This issue most commonly appears in documents that use Dublin Core Metadata Initiative (DCMI) metadata, which historically relied on scheme to indicate the encoding format for dates, identifiers, and subject classifications.
How to fix it
There are several approaches depending on your use case:
- Simply remove the scheme attribute if the format is already clear from context (e.g., ISO 8601 dates are universally understood).
- Incorporate the scheme into the name attribute by using a more specific property name that implies the scheme.
- Include the scheme declaration in the content value so the format information is preserved within the value itself.
For Dublin Core metadata specifically, the modern recommended approach is to use the DCTERMS namespace with RDFa or to simply drop the scheme attribute, since most date formats like YYYY-MM-DD are unambiguous.
Examples
Obsolete: using the scheme attribute
This triggers the validation error because scheme is not a valid attribute in HTML5:
<meta name="DC.Date.Created" scheme="W3CDTF" content="2009-11-30">
Another common example with subject classification:
<meta name="DC.Subject" scheme="LCSH" content="Web development">
Fixed: removing the scheme attribute
If the value format is self-evident (as with ISO 8601 dates), simply remove scheme:
<meta name="DC.Date.Created" content="2009-11-30">
Fixed: incorporating the scheme into the value
When the scheme information is important for processors to understand the value, embed it in the content attribute:
<meta name="DC.Subject" content="LCSH: Web development">
Fixed: using a more specific property name
You can make the scheme implicit by using a more descriptive name value:
<meta name="DCTERMS.created" content="2009-11-30">
Fixed: using RDFa for richer metadata
For documents that require precise, machine-readable metadata with explicit schemes, consider using RDFa attributes instead of the obsolete scheme:
<meta property="dcterms:created" content="2009-11-30">
This approach is compatible with HTML5 and provides the same semantic richness that the scheme attribute was originally designed to offer.
In older HTML practices, developers sometimes used <meta http-equiv="Content-Language" content="en"> inside the <head> to declare the document’s primary language. The HTML living standard now marks this as obsolete because it was an unreliable and indirect way to communicate language information. It attempted to mirror an HTTP header rather than being a true part of the document structure, and its behavior was inconsistently implemented across browsers.
The lang attribute on the <html> element is the correct modern approach. It directly associates the language with the document’s DOM tree, which has several important benefits:
- Accessibility: Screen readers rely on the lang attribute to select the correct pronunciation rules and voice profile. Without it, assistive technology may mispronounce content or fall back to a default language that doesn’t match the text.
- Browser behavior: Browsers use the lang attribute to make decisions about hyphenation, font selection, quotation mark styling, spell-checking, and other language-sensitive rendering.
- Search engines: Declaring the language helps search engines index and serve content to the appropriate audience.
- CSS targeting: The :lang() pseudo-class selector works based on the lang attribute, enabling language-specific styling.
The lang attribute also supports granular, element-level language declarations. If your page is primarily in English but contains a French quote, you can set lang="fr" on that specific element — something the <meta> approach could never do.
Examples
Incorrect: using the obsolete meta tag
This triggers the W3C validation warning because <meta http-equiv="Content-Language"> is obsolete for specifying the document language.
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Language" content="en">
<title>My Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>
Correct: using the lang attribute on <html>
Remove the <meta http-equiv="Content-Language"> tag and add the lang attribute to the <html> element instead.
<!DOCTYPE html>
<html lang="en">
<head>
<title>My Page</title>
</head>
<body>
<p>Hello, world!</p>
</body>
</html>
Correct: mixed-language content
Use the lang attribute on the root element for the primary language, then override it on specific elements as needed.
<!DOCTYPE html>
<html lang="en">
<head>
<title>Multilingual Page</title>
</head>
<body>
<p>The French word for hello is <span lang="fr">bonjour</span>.</p>
<blockquote lang="de">
<p>Die Grenzen meiner Sprache bedeuten die Grenzen meiner Welt.</p>
</blockquote>
</body>
</html>
Common language codes
Use a valid BCP 47 language tag as the value of the lang attribute. Here are some frequently used codes:
| Code | Language |
|---|---|
| en | English |
| fr | French |
| de | German |
| es | Spanish |
| pt-BR | Brazilian Portuguese |
| zh-Hans | Simplified Chinese |
| ja | Japanese |
The fix is straightforward: remove any <meta http-equiv="Content-Language"> tags from your <head> and ensure your <html> element includes a lang attribute with the appropriate language code. This single change resolves the validation warning while improving your document’s accessibility, rendering, and standards compliance.
¿Listo para validar tus sitios?
Comienza tu prueba gratuita hoy.