What does Google say about SEO? /

Official statement

John Mueller indicated on Twitter that the content of "id=" attributes in an HTML tag (example: <div id="content" class="content"...>) is not taken into account (in terms of text relevance analysis) by the algorithm...
📅
Official statement from (8 years ago)

What you need to understand

Google has clarified that values contained in HTML tag "id" attributes are not analyzed as textual content by its relevance algorithms. Concretely, if you have code like <div id="best-seo-services-paris">, the words "best", "seo", "services" and "paris" contained in this attribute do not contribute to your page's ranking for these queries.

This clarification is important because it clearly distinguishes the technical structure of HTML code (intended for developers and JavaScript scripts) from editorial content (intended for users and considered for search rankings). The "id" attributes primarily serve to identify elements for CSS, JavaScript and internal navigation anchors.

Key points to remember:

  • "id" attributes don't count as textual content for the relevance algorithm
  • Their function is purely technical: anchoring, CSS/JavaScript targeting, DOM manipulation
  • Stuffing these attributes with keywords will provide no SEO benefit
  • This rule protects Google against an obvious form of technical spam
  • Visible content readable by the user remains the absolute priority

SEO Expert opinion

This statement is perfectly consistent with field observations and search engine logic. If Google considered "id" attributes in its semantic analysis, it would create a massive attack surface for spam: any webmaster could inject dozens of keywords into each tag without it being visible to the user. The signal-to-noise ratio would become catastrophic for results quality.

However, some nuance is needed: while the "id" attribute doesn't count for textual relevance, it remains indirectly useful for SEO. A well-named "id" attribute facilitates internal navigation anchor creation (URLs with #section), improves accessibility (essential for Core Web Vitals), and enables JavaScript interactions that can enhance user experience. These indirect factors can influence behavioral metrics that Google observes.

Warning: Don't confuse "id" attributes with other attributes like "alt" for images, "title" for links, or meta tag content. The latter do have a documented SEO role, unlike "id" which remains in the purely technical domain.

Practical impact and recommendations

Recommended actions following this clarification:

  • Immediately stop any practice of stuffing "id" attributes with keywords hoping for SEO gains
  • Use "id" attributes only for their technical function: anchoring, DOM manipulation, CSS/JavaScript targeting
  • Favor descriptive and logical id names to facilitate code maintenance (e.g., "header-navigation", "footer-contact")
  • Focus your SEO efforts on visible content: Hn tags, paragraphs, lists, image alt text
  • Leverage "id" attributes to create tables of contents with internal anchors, which improves UX and can generate sitelinks
  • Audit your templates to identify and clean any keyword stuffing in technical attributes
  • Train your development teams so they don't mix SEO optimization with technical code structure
In summary: "id" attributes are invisible to the relevance algorithm. Use them exclusively for their legitimate technical functions. Your SEO time should be invested in real content that's visible and useful to the user. Any keyword stuffing in technical attributes is not only useless but can reveal outdated practices that undermine your overall approach.
Algorithms Content AI & SEO JavaScript & Technical SEO Penalties & Spam Social Media

Related statements

💬 Comments (0)

Be the first to comment.

2000 characters remaining
🔔

Get real-time analysis of the latest Google SEO declarations

Be the first to know every time a new official Google statement drops — with full expert analysis.

No spam. Unsubscribe in one click.