Skip to main content
HTML Validation

Attribute “xmlns:fb” not allowed here.

About This HTML Issue

The xmlns:fb attribute was an XML namespace declaration used to enable FBML (Facebook Markup Language) tags on websites. FBML allowed developers to embed Facebook-specific elements like <fb:like>, <fb:comments>, and <fb:share-button> directly in their HTML. Facebook officially retired FBML in 2011 and replaced it with the JavaScript SDK and social plugins, yet many websites still carry this outdated namespace declaration in their markup.

In HTML5, the only xmlns attribute allowed on the <html> element is the standard xmlns="http://www.w3.org/1999/xhtml", and even that is optional. Custom namespace prefixes like xmlns:fb or xmlns:og are XML constructs that have no meaning in HTML5 and are flagged as validation errors.

Why This Is a Problem

  • Standards compliance: HTML5 does not support arbitrary XML namespace declarations. The xmlns:fb attribute violates the HTML specification, producing a validation error.
  • Dead technology: FBML no longer functions. Facebook’s servers no longer process FBML tags, so the namespace serves no purpose whatsoever.
  • Code cleanliness: Keeping deprecated, non-functional attributes in your markup adds confusion for developers maintaining the codebase and suggests the site hasn’t been updated in a long time.

How to Fix It

  1. Remove xmlns:fb (and any other custom namespace like xmlns:og) from your <html> tag.
  2. Remove any FBML tags such as <fb:like>, <fb:comments>, or <fb:share-button> from your page content.
  3. Replace with modern alternatives:
    • Use the Facebook JavaScript SDK for social plugins.
    • Use Open Graph <meta> tags in the <head> to control how your pages appear when shared on Facebook. These <meta> tags use the property attribute (e.g., property="og:title") and do not require any namespace declaration in HTML5.

Examples

❌ Invalid: Using xmlns:fb on the <html> tag

<!DOCTYPE html>
<html lang="en" xmlns:fb="http://ogp.me/ns/fb#">
  <head>
    <title>My Page</title>
  </head>
  <body>
    <fb:like href="https://example.com" width="300"></fb:like>
  </body>
</html>

This triggers the error “Attribute ‘xmlns:fb’ not allowed here” because HTML5 does not permit custom XML namespace prefixes on the <html> element. The <fb:like> tag is also invalid HTML and no longer functional.

✅ Valid: Using Open Graph meta tags and the JavaScript SDK

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>My Page</title>
    <meta property="og:title" content="My Page">
    <meta property="og:description" content="A description of my page.">
    <meta property="og:url" content="https://example.com">
    <meta property="og:image" content="https://example.com/image.jpg">
  </head>
  <body>
    <h1>My Page</h1>
<!-- Facebook Like button using the JavaScript SDK -->

    <div class="fb-like" data-href="https://example.com" data-width="300" data-layout="button_count"></div>
    <script async defer crossorigin="anonymous"
      src="https://connect.facebook.net/en_US/sdk.js#xfbml=1&version=v18.0">
    </script>
  </body>
</html>

The xmlns:fb attribute is gone, Open Graph metadata is provided via standard <meta> tags, and the like button is rendered using Facebook’s JavaScript SDK with data-* attributes—all fully valid HTML5.

Find issues like this automatically

Rocket Validator scans thousands of pages in seconds, detecting HTML issues across your entire site.

Help us improve our guides

Was this guide helpful?

Ready to validate your sites?
Start your trial today.