<?xml version="1.0" encoding="UTF-8"?>    <rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
      <channel>
        <title>How do I defer Google Recaptcha V3</title>
        <link>https://interactivetools.com/forum/forum-posts.php?How-do-I-defer-Google-Recaptcha-V3-82565</link>
        <description></description>
        <pubDate>Sat, 07 Mar 2026 10:26:33 -0800</pubDate>
        <language>en-us</language>
        <atom:link href="https://interactivetools.com/forum/forum-posts.php?rss=1&amp;How-do-I-defer-Google-Recaptcha-V3-82565" rel="self" type="application/rss+xml" />

                <item>
          <title>How do I defer Google Recaptcha V3</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2246078#post2246078</link>
          <description><![CDATA[<p>Spot on, thanks!</p>]]></description>
          <pubDate>Fri, 05 Aug 2022 00:39:42 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2246078#post2246078</guid>
        </item>
                <item>
          <title>How do I defer Google Recaptcha V3</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2246077#post2246077</link>
          <description><![CDATA[<p>Thanks John!<br /><br />It appears that the script provided in Google's docs is slightly inaccurate - at least for our usage here - so I've made a small change and it appears to be working with async. For anyone else reading, here is the final updated script:</p>
<pre class="language-javascript"><code>    &lt;script async src="<a href="https://www.google.com/recaptcha/api.js?render=" rel="nofollow">https://www.google.com/recaptcha/api.js?render=</a>&lt;?php echo urlencode(recaptcha_settings('site_key')); ?&gt;"&gt;&lt;/script&gt;

    &lt;script&gt;
        
      if(typeof grecaptcha === 'undefined') {
        grecaptcha = {};
      }
      grecaptcha.ready = function(cb){
        if(typeof grecaptcha.execute === 'undefined') {
          // window.__grecaptcha_cfg is a global variable that stores reCAPTCHA's
          // configuration. By default, any functions listed in its 'fns' property
          // are automatically executed when reCAPTCHA loads.
          const c = '___grecaptcha_cfg';
          window[c] = window[c] || {};
          (window[c]['fns'] = window[c]['fns']||[]).push(cb);
        } else {
          cb();
        }
      }
    
      grecaptcha.ready(function(){

          grecaptcha.execute('&lt;?php echo urlencode(recaptcha_settings('site_key')); ?&gt;', {action: &lt;?php echo json_encode(recaptcha_settings('page')); ?&gt;}).then(function(token) {

            document.getElementById("g-recaptcha-response").value = token;

          });

      });

    &lt;/script&gt;</code></pre>
<p>Cheers,</p>]]></description>
          <pubDate>Thu, 04 Aug 2022 16:51:37 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2246077#post2246077</guid>
        </item>
                <item>
          <title>How do I defer Google Recaptcha V3</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2246076#post2246076</link>
          <description><![CDATA[<p>Thanks Daniel, I'll submit the request</p>]]></description>
          <pubDate>Thu, 04 Aug 2022 10:03:04 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2246076#post2246076</guid>
        </item>
                <item>
          <title>How do I defer Google Recaptcha V3</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2246075#post2246075</link>
          <description><![CDATA[<p>Hey Jeff,</p>
<p>This is something I could check out at no charge - it'd be useful for us to know as well. But as it's a minor issue I also understand if it's not worth the trouble.</p>
<p>Take care,</p>]]></description>
          <pubDate>Thu, 04 Aug 2022 09:52:12 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2246075#post2246075</guid>
        </item>
                <item>
          <title>How do I defer Google Recaptcha V3</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2246074#post2246074</link>
          <description><![CDATA[<p>Hi Daniel</p>
<p>Thanks for the reply. I did notice the missing API key in your first post and tried with and without.</p>
<p>I won't post a 2nd level request. I don't have budget to fix it, and the problem is only a small one. I aim to make my pages load as fast as they can, but this one is actually pretty quick already.</p>
<p>Thanks for trying.</p>
]]></description>
          <pubDate>Wed, 03 Aug 2022 23:45:14 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2246074#post2246074</guid>
        </item>
                <item>
          <title>How do I defer Google Recaptcha V3</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2246073#post2246073</link>
          <description><![CDATA[<p>Hey Jeff,</p>
<p>I didn't notice that the second snippet was missing the API key when loading api.js - that may be the issue here. Can you try this out?</p>
<pre class="language-javascript"><code>&lt;script async src="<a href="https://www.google.com/recaptcha/api.js?render=" rel="nofollow">https://www.google.com/recaptcha/api.js?render=</a>&lt;?php echo urlencode(recaptcha_settings('site_key')); ?&gt;"&gt;&lt;/script&gt;
&lt;script&gt;
  // How this code snippet works:
  // This logic overwrites the default behavior of `grecaptcha.ready()` to
  // ensure that it can be safely called at any time. When `grecaptcha.ready()`
  // is called before reCAPTCHA is loaded, the callback function that is passed
  // by `grecaptcha.ready()` is enqueued for execution after reCAPTCHA is
  // loaded.
  if(typeof grecaptcha === 'undefined') {
    grecaptcha = {};
  }
  grecaptcha.ready = function(cb){
    if(typeof grecaptcha === 'undefined') {
      // window.__grecaptcha_cfg is a global variable that stores reCAPTCHA's
      // configuration. By default, any functions listed in its 'fns' property
      // are automatically executed when reCAPTCHA loads.
      const c = '___grecaptcha_cfg';
      window[c] = window[c] || {};
      (window[c]['fns'] = window[c]['fns']||[]).push(cb);
    } else {
      cb();
    }
  }

    grecaptcha.ready(function() {
        grecaptcha.execute('&lt;?php echo urlencode(recaptcha_settings('site_key')); ?&gt;', {action: &lt;?php echo json_encode(recaptcha_settings('page')); ?&gt;}).then(function(token) {
          document.getElementById("g-recaptcha-response").value = token;
        });
    });
&lt;/script&gt;</code></pre>
<p>If that doesn't work, feel free to send a 2nd-level support request (<a href="https://www.interactivetools.com/support/request/" rel="nofollow">https://www.interactivetools.com/support/request/</a>) and I can take a look at it directly.</p>
<p>Thanks,</p>]]></description>
          <pubDate>Wed, 03 Aug 2022 18:04:56 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2246073#post2246073</guid>
        </item>
                <item>
          <title>How do I defer Google Recaptcha V3</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2246072#post2246072</link>
          <description><![CDATA[<p>Thanks for the reply Daniel. I'm still getting the error: </p>
<p>Recaptcha response not found, please ensure JavaScript is enabled in your browser</p>]]></description>
          <pubDate>Wed, 03 Aug 2022 09:39:07 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2246072#post2246072</guid>
        </item>
                <item>
          <title>How do I defer Google Recaptcha V3</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2246071#post2246071</link>
          <description><![CDATA[<p>Hi Jeff,</p>
<p>I believe in Google's example, you're supposed to replace the "grecaptcha.ready" portion with what you actually want to use. So I think it would look something like this: </p>
<pre class="language-javascript"><code>&lt;script async src="<a href="https://www.google.com/recaptcha/api.js" rel="nofollow">https://www.google.com/recaptcha/api.js</a>"&gt;&lt;/script&gt;
&lt;script&gt;
  // How this code snippet works:
  // This logic overwrites the default behavior of `grecaptcha.ready()` to
  // ensure that it can be safely called at any time. When `grecaptcha.ready()`
  // is called before reCAPTCHA is loaded, the callback function that is passed
  // by `grecaptcha.ready()` is enqueued for execution after reCAPTCHA is
  // loaded.
  if(typeof grecaptcha === 'undefined') {
    grecaptcha = {};
  }
  grecaptcha.ready = function(cb){
    if(typeof grecaptcha === 'undefined') {
      // window.__grecaptcha_cfg is a global variable that stores reCAPTCHA's
      // configuration. By default, any functions listed in its 'fns' property
      // are automatically executed when reCAPTCHA loads.
      const c = '___grecaptcha_cfg';
      window[c] = window[c] || {};
      (window[c]['fns'] = window[c]['fns']||[]).push(cb);
    } else {
      cb();
    }
  }

    grecaptcha.ready(function() {
        grecaptcha.execute('&lt;?php echo urlencode(recaptcha_settings('site_key')); ?&gt;', {action: &lt;?php echo json_encode(recaptcha_settings('page')); ?&gt;}).then(function(token) {
          document.getElementById("g-recaptcha-response").value = token;
        });
    });
&lt;/script&gt;</code></pre>
<p>Can you try that out, and let me know if it fixes the issue?</p>
<p>Thanks!</p>]]></description>
          <pubDate>Tue, 02 Aug 2022 14:28:18 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2246071#post2246071</guid>
        </item>
                <item>
          <title>How do I defer Google Recaptcha V3</title>
          <link>https://interactivetools.com/forum/forum-posts.php?postNum=2246069#post2246069</link>
          <description><![CDATA[<p>Hi</p>
<p>I am using the Google Recaptcha V3 plugin (recaptchaPluginV3.php). Everything works great without using async but it's slowing the loading of my page. To defer it I assume I need to add async to line 167 of the plugin like this: </p>
<pre class="language-markup"><code>function recaptcha_displayHeaders($action = 'default') {

  if(isset($GLOBALS['INCLUDE_RECAPTCHA'])):

  ?&gt;

    &lt;script async src="<a href="https://www.google.com/recaptcha/api.js?render=" rel="nofollow">https://www.google.com/recaptcha/api.js?render=</a>&lt;?php echo urlencode(recaptcha_settings('site_key')); ?&gt;"&gt;&lt;/script&gt;

    &lt;script&gt;

    grecaptcha.ready(function() {

        grecaptcha.execute('&lt;?php echo urlencode(recaptcha_settings('site_key')); ?&gt;', {action: &lt;?php echo json_encode(recaptcha_settings('page')); ?&gt;}).then(function(token) {

          document.getElementById("g-recaptcha-response").value = token;

        });

    });

    &lt;/script&gt;

  &lt;?php</code></pre>
<p>But this results in the error: <span>Recaptcha response not found, please ensure JavaScript is enabled in your browser.</span></p>
<p>I've found some documentation that should help, but I can't fathom it out. <a href="https://developers.google.com/recaptcha/docs/loading" rel="nofollow">https://developers.google.com/recaptcha/docs/loading</a></p>
<p>The docs say:</p>
<p><span>When loading reCAPTCHA asynchronously, keep in mind that reCAPTCHA cannot be used until it has finished loading… In some situations, adjusting script ordering can be enough to prevent race conditions. Alternatively, you can prevent race conditions by including the following code snippet on pages that load reCAPTCHA. If you are using<code>grecaptcha.ready()</code> to wrap API calls, add the following code snippet to ensure that reCAPTCHA can be called at any time.</span></p>
<p><span>I would appreciate a bit of help incorporating this, as when I try I still get an error.</span></p>
<pre class="language-markup"><code>&lt;script async src="<a href="https://www.google.com/recaptcha/api.js" rel="nofollow">https://www.google.com/recaptcha/api.js</a>"&gt;&lt;/script&gt;
&lt;script&gt;
  // How this code snippet works:
  // This logic overwrites the default behavior of `grecaptcha.ready()` to
  // ensure that it can be safely called at any time. When `grecaptcha.ready()`
  // is called before reCAPTCHA is loaded, the callback function that is passed
  // by `grecaptcha.ready()` is enqueued for execution after reCAPTCHA is
  // loaded.
  if(typeof grecaptcha === 'undefined') {
    grecaptcha = {};
  }
  grecaptcha.ready = function(cb){
    if(typeof grecaptcha === 'undefined') {
      // window.__grecaptcha_cfg is a global variable that stores reCAPTCHA's
      // configuration. By default, any functions listed in its 'fns' property
      // are automatically executed when reCAPTCHA loads.
      const c = '___grecaptcha_cfg';
      window[c] = window[c] || {};
      (window[c]['fns'] = window[c]['fns']||[]).push(cb);
    } else {
      cb();
    }
  }

  // Usage
  grecaptcha.ready(function(){
    grecaptcha.render("container", {
      sitekey: "ABC-123"
    });
  });
&lt;/script&gt;
</code></pre>]]></description>
          <pubDate>Sat, 30 Jul 2022 05:40:14 -0700</pubDate>
          <guid isPermaLink="true">forum-posts.php?postNum=2246069#post2246069</guid>
        </item>
              </channel>
    </rss>
  