Skip to main content

Why is Google adding an origin trial token meta tag with recaptcha?

  • May 8, 2025
  • 4 replies
  • 113 views

Forum|alt.badge.img+1

Have noticed this appearing in the document head when inspecting the page. Just wondering what this is and why it's been added. Does anyone know?

 

Thanks

4 replies

a_aleinikov
Forum|alt.badge.img+8
  • Bronze 2
  • May 10, 2025

Hi @GoogleUser2 ,

The origin trial token meta tag you see is added by Google to enable experimental features (like performance or security improvements) in supported browsers. When using reCAPTCHA, Google may include this to test upcoming changes or optimizations on selected sites.

It’s safe and handled by Google — no action is usually needed on your side.


Forum|alt.badge.img+1
  • Author
  • New Member
  • May 14, 2025

Seems strange that all my websites have this added which suggests either all websites using v3 recaptcha are being targeted or Google just likes me... not sure which 😉


WPProDev2412
  • New Member
  • September 1, 2026

This causing issue because it added immediately after <head> tag.
IN Core Vital score I get flag in Best Practices section saying “ A character encoding declaration is required. It can be done with a <meta> tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header ”

In my coding I have added <meta charset="utf-8"> after the <head> tag but in between google recaptcha add this long code “ <meta http-equiv="origin-trial" content="A7vZI3v+Gz7JfuRolKNM4Aff6zaGuT7X0mf3wtoZTnKv6497cVMnhy03KDqX7kBz/q/iidW7srW31oQbBt4VhgoAAACUeyJvcmlnaW4iOiJodHRwczovL3d3dy5nb29nbGUuY29tOjQ0MyIsImZlYXR1cmUiOiJEaXNhYmxlVGhpcmRQYXJ0eVN0b3JhZ2VQYXJ0aXRpb25pbmczIiwiZXhwaXJ5IjoxNzU3OTgwODAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ=="> ” Which is more then 1024 bytes.

Anyone has a solution for this?


hzmndt
Staff
Forum|alt.badge.img+12
  • Staff
  • September 1, 2026

@WPProDev2412 see if below help (Created by Gemini): 

🧐 Why This Issue Occurs

  1. What reCAPTCHA is doing: When reCAPTCHA loads, its script dynamically prepends a third-party Origin Trial meta tag (DisableThirdPartyStoragePartitioning3) to the top of <head>:
     

    html

    <meta http-equiv="origin-trial" content="A7vZI3v+Gz7JfuRolKNM4Aff6zaGuT7X0mf3wtoZTnKv6497cVMnhy03KDqX7kBz/q/iidW7srW31oQbBt4VhgoAAACUeyJvcmlnaW4iOiJodHRwczovL3d3dy5nb29nbGUuY29tOjQ0MyIsImZlYXR1cmUiOiJEaXNhYmxlVGhpcmRQYXJ0eVN0b3JhZ2VQYXJ0aXRpb25pbmczIiwiZXhwaXJ5IjoxNzU3OTgwODAwLCJpc1N1YmRvbWFpbiI6dHJ1ZSwiaXNUaGlyZFBhcnR5Ijp0cnVlfQ==">

  2. Why Lighthouse / Core Web Vitals Flags It: HTML5 specs and Lighthouse require the character encoding declaration to appear completely within the first 1024 bytes of the HTML document. Because reCAPTCHA injects this long tag at the very top of <head>, it pushes your <meta charset="utf-8"> tag further down the DOM hierarchy, triggering the warning during Lighthouse's DOM inspection.

🛠️ How to Fix It (Solutions)

As stated in the Lighthouse audit rule:

"A character encoding declaration is required. It can be done with a <meta> tag in the first 1024 bytes of the HTML or in the Content-Type HTTP response header"

When your web server sends charset=utf-8 in the HTTP header, the browser and Lighthouse determine encoding at the network level before parsing the DOM, completely bypassing reCAPTCHA's DOM injection.

  • For Apache / .htaccess (or WordPress / cPanel): Add the following line to your .htaccess file:

     

    apache

    AddDefaultCharset UTF-8

    (Or explicitly set the header):

     

    apache

    <IfModule mod_headers.c>

    Header set Content-Type "text/html; charset=utf-8"

    </IfModule>

  • For Nginx: Add inside your server { ... } or location / { ... } block:

     

    nginx

    charset utf-8;

  • For PHP / WordPress functions.php:

     

    php

    header('Content-Type: text/html; charset=utf-8');

  • For Cloudflare (Transform Rules): Create a Response Header Modification Rule:

    • Set Static Header: Content-Type -> text/html; charset=utf-8

Solution 2: Defer / Async the reCAPTCHA Script

If the reCAPTCHA script is loaded synchronously in the <head>, it executes immediately while the document is parsing.

  • Ensure the script tag has async defer:
     

    html

    <script src="https://www.google.com/recaptcha/api.js" async defer></script>

  • For WordPress: If using a contact form plugin (e.g. Contact Form 7, WPForms, Gravity Forms), ensure reCAPTCHA is only loaded on pages that actually contain a form rather than sitewide, or use an asset optimization plugin (e.g. Perfmatters / WP Rocket) to Delay JavaScript Execution on reCAPTCHA until user interaction.

Summary Checklist for WPProDev2412:

  1. Add AddDefaultCharset UTF-8 to your .htaccess (or charset utf-8; in Nginx).
  2. Re-run Lighthouse / PageSpeed Insights.
  3. The "A character encoding declaration is required" warning will immediately clear.