Skip to content
Browse all guides

Issue #110 · standard

Issue 110

What is this issue?

This issue checks whether your web pages have a properly declared Content-Language signal, either via the HTTP Content-Language response header or the deprecated <meta http-equiv="content-language"> HTML meta tag.

A passing implementation includes:

  • An HTTP Content-Language response header (preferred method)
  • OR a valid <meta http-equiv="content-language" content="xx"> tag in the <head> section
  • The language value should be a valid BCP 47 language tag (e.g., en, en-US, fr)
  • The value should be consistent with the <html lang> attribute

Example of correct implementation (HTTP header):

Content-Language: en-US

Example of correct implementation (HTML meta, deprecated but still used):

<meta http-equiv="content-language" content="en-US" />

Without this declaration, search engines may have weaker language targeting signals, especially for multilingual sites.

Why does it matter?

The Content-Language declaration helps search engines understand your content's language:

  • Indexability: Search engines use language signals to serve the correct language version of your pages to users in different regions.
  • Duplicate content: Proper language declarations help search engines understand that translated content is not duplicate content, but alternate language versions.
  • International SEO: For multilingual websites, consistent language signals across HTTP headers, HTML attributes, and meta tags strengthen international SEO efforts.
  • AI Search / AEO: AI-powered search systems need to understand content language to provide accurate answers to users in their preferred language.

Resolving this issue improves your SEO health score by strengthening language targeting signals, which is particularly important for multilingual websites and international SEO.

How to fix it

Follow these steps to implement the Content-Language declaration correctly:

  1. Choose your method (HTTP header is preferred over HTML meta):

    Method 1: HTTP Header (Recommended)

    • Configure your web server to send the Content-Language HTTP header
    • Example for Apache (.htaccess):
      Header set Content-Language "en-US"
      
    • Example for Nginx:
      add_header Content-Language "en-US";
      

    Method 2: HTML Meta Tag (Deprecated but acceptable)

    • Add the meta tag to your HTML <head> section:
      <meta http-equiv="content-language" content="en-US" />
      
    • Note: This method is deprecated in HTML5. The HTTP header or <html lang> attribute are preferred.
  2. Use valid BCP 47 language tags: Refer to the IANA Language Subtag Registry for valid language tags.

  3. Ensure consistency: Make sure the Content-Language value matches:

    • The <html lang> attribute value
    • The actual language of the page content
  4. For multilingual sites: Ensure each page declares the correct language for its content.

  5. Verify implementation:

    • Use browser developer tools to check HTTP response headers
    • Use the W3C Markup Validation Service to check HTML meta tags
    • Test with search engine tools to ensure language targeting works correctly

Note: The <html lang> attribute (covered in issue-105) is the primary method for declaring page language. Content-Language provides additional signals but should be consistent with lang.

Examples

Example 1: Correct Implementation with HTTP Header

Scenario: A properly configured page with Content-Language HTTP header.

Correct State (Passes):

HTTP/1.1 200 OK
Content-Type: text/html; charset=UTF-8
Content-Language: en-US
...
<html lang="en-US">
  <head>
    <meta charset="UTF-8" />
    <title>English US Page</title>
  </head>
  <body>
    <p>Content in American English.</p>
  </body>
</html>

Example 2: Missing Content-Language Declaration

Scenario: Page has no Content-Language declaration.

Problematic State (Fails):

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Page Title</title>
  </head>
  <body>
    <p>Content without Content-Language declaration.</p>
  </body>
</html>

Why it fails: Without Content-Language, search engines may have weaker language targeting signals.

Corrected State (Passes):

  • Add Content-Language: en HTTP header
  • Or add <meta http-equiv="content-language" content="en"> (though HTTP header is preferred)

Example 3: Conflicting Language Declarations

Scenario: Content-Language header conflicts with html lang attribute.

Problematic State (Fails):

HTTP/1.1 200 OK
Content-Language: fr
...
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Page Title</title>
  </head>
  <body>
    <p>Content in English but header says French.</p>
  </body>
</html>

Why it fails: Conflicting language signals confuse search engines.

Corrected State (Passes):

HTTP/1.1 200 OK
Content-Language: en
...
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <title>Page Title</title>
  </head>
  <body>
    <p>Content in English with consistent language declarations.</p>
  </body>
</html>

Example 4: Using Deprecated Meta Tag Method

Scenario: Page uses deprecated meta tag instead of HTTP header.

Problematic State (Warning):

<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="content-language" content="en" />
    <title>Page Title</title>
  </head>
  <body>
    <p>Content using deprecated meta tag method.</p>
  </body>
</html>

Why it's problematic: The meta tag method is deprecated in HTML5.

Corrected State (Passes):

  • Remove the meta tag
  • Add Content-Language: en as an HTTP response header
  • Keep <html lang="en"> as the primary in-document declaration

How PixyScan detects this

PixyScan performs the following checks to detect this issue:

  1. HTTP header check: The crawler examines the HTTP Content-Language response header from the page request.

  2. Meta tag search: It looks for a <meta> tag with the attribute http-equiv="content-language" in the <head> section.

  3. Value resolution: PixyScan determines the effective value:

    • HTTP headers take precedence over HTML meta tags
    • If both are present, the HTTP header value is used
    • If neither is present, the value is considered missing
  4. Validation: If a value is found, PixyScan:

    • Validates it against BCP 47 language tag format
    • Compares it to the <html lang> attribute value (from issue-105)
    • Checks for conflicts between the two
  5. Deprecation warning: The crawler flags if the deprecated <meta http-equiv="content-language"> method is used instead of the HTTP header.

  6. Pass/Fail determination:

    • Passes: If a valid Content-Language declaration exists (HTTP header or meta tag) and is consistent with the <html lang> attribute
    • Fails: If no declaration exists, the value is invalid, or it conflicts with the <html lang> attribute

The detection focuses on whether a valid language declaration exists and is consistent across different methods, not on whether the specific language matches the content (though mismatches may be flagged as warnings).

References