'WordPress disable "regenerator-runtime-js" and "wp-polyfill-js"

These two srcripts are added on every footer of my WordPress pages. Is it possible to remove them via functions.php?



Solution 1:[1]

The following code in your functions.php should remove wp-polyfill and regenerator-runtime:

function deregister_polyfill(){
    wp_deregister_script( 'wp-polyfill' );
    wp_deregister_script( 'regenerator-runtime' );
}
add_action( 'wp_enqueue_scripts', deregister_polyfill, 11 );

See also: wp_deregister_script

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Thomas Krakow