Add type to enqueued script inside plugin
There’s a filter: script_loader_tag. add_filter( ‘script_loader_tag’, ‘wpse397773_change_script_tags’, 10, 3 ); function wpse397773_change_script_tags( $tag, $handle, $src ) { $tag = ‘<script type=”text/plain” src=”‘ . $src . ‘” id=”‘ . $handle . ‘-js”></script>’; return $tag; } This should change all the <script> tags in the page (assuming they’re properly enqueued) to <script type=”text/plain”>. Update: To only change … Read more