I get an error when I tried to defer the load of gravityform scripts

I want to defer the load of gravityforms recaptcha scripts and all the gravityforms scripts,I tried using this code Move scripts to footer including reCAPTCHA - Droplr but it didn’t work, I get the following js errors

gravityforms.min.js:1 Uncaught TypeError: gform.initializeOnLoaded is not a function
    at gravityforms.min.js:1:35801
(anonymous) gravityforms.min.js:1
jquery-migrate.min.js?ver=3.3.2:2 JQMIGRATE: Migrate is installed, version 3.3.2
gravityforms.min.js?ver=2.6.9:1 Uncaught TypeError: gform.initializeOnLoaded is not a function
    at gravityforms.min.js?ver=2.6.9:1:35801
(anonymous) @ gravityforms.min.js?ver=2.6.9:1
(index):1469 Uncaught TypeError: gform.initializeOnLoaded is not a function
    at HTMLDocument.<anonymous> ((index):1469:68)
(anonymous) @ (index):1469
(index):1474 Uncaught TypeError: gform.initializeOnLoaded is not a function
    at HTMLDocument.<anonymous> ((index):1474:68)
(anonymous) @ (index):1474
(index):1477 Uncaught TypeError: gform.initializeOnLoaded is not a function
    at HTMLDocument.<anonymous> ((index):1477:68)
(anonymous) @ (index):1477
(index):1482 Uncaught TypeError: gform.initializeOnLoaded is not a function
    at HTMLDocument.<anonymous> ((index):1482:68)
(anonymous) @ (index):1482
common-modules.js:1 Uncaught TypeError: false is not a

How can I properly defer the load of all the gravityforms scripts? the solution I tried is supposed to be the standard way to do it provided by an admin of this forum

The gravityforms plugins that I have installed are:

  • gravityformswebhooks
  • gravityformsrecaptcha
  • gravityforms

Did you use any caching or 3rd party plugin to defer or any custom coding?
For custom coding, please share full code so we could take a look.

That code is only compatible with versions 2.4 and older. For version 2.5 and newer, the scripts are already deferred.


This script is added by gravityforms and is blocking the rendering of the page, is added synchronously and is affecting the LCP score.

That script is NOT added by Gravity Forms. The only reCAPTCHA script added by Gravity Forms is the one using the https://www.google.com/recaptcha/api.js URL.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.