Delay jQuery and Elementor Scripts Until the First Touch
On a phone, a page builder runs its scripts for hundreds of milliseconds before the visitor has done anything. PageSpeed reports this as Total Blocking Time. The option Delay jQuery and Elementor scripts until the first touch keeps those scripts in the page, but makes them wait for the first action of the visitor. It is off by default.
How it works
- The page keeps the scripts of WordPress jQuery and Elementor, and the inline scripts that call them. They do not run yet, and their order does not change.
- The first pointer, touch, key, wheel or scroll event starts them, one after another. If the visitor does nothing, they start 5 seconds after the page has loaded.
- An element that Elementor shows only when it is visible is shown at once. The first click on a tab title is replayed after the scripts have started.
When it is not used
The option does not change the pages of logged-in visitors, the admin, Elementor previews or the Elementor editor.
Keep a script out of the delay
Under Scripts that must not wait enter one part of a script address or one WordPress handle per line, for example /elementor/assets/js/frontend.min.js. A matching script stays where it is. jQuery and Elementor are delayed together and in order, so leave one of them out only if you know the other does not need it.
What to expect
In a measurement on a copy of a real Elementor home page, Total Blocking Time fell by about 80 milliseconds. At the same time Speed Index became worse, because the first screen waits for a touch. For most sites the gain is small. Turn the option on, measure the page again, and check the menus, sliders, counters and forms on a phone. Leave it off if the page looks or works differently afterwards.
