0
votes

I am working on a Wordpress website with Gutenberg builder, I finally manage to add the async and defer to the scripts, but inline script are which is depend on the defer scripts giving error. I am not able to add defer to those inline scripts Those scripts have id tag in theme

<script type='text/javascript' id='wp-blocks-js-translations'>
...
</script>

<script type='text/javascript' id='wp-data-js-after'>
....
<script>

Is there any way to add defer to these inline scripts?

1

1 Answers

0
votes

Inline and internal Javascript will load with the HTML page, so they do not require an additional request in order to load. Therefore you don't need to use async/defer on the script tag.