Title: Remove text/javascript
Last modified: August 27, 2021

---

# Remove text/javascript

 *  Resolved [Web Expert](https://wordpress.org/support/users/seldimi/)
 * (@seldimi)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/remove-text-javascript/)
 * Hello.
    Can you remove the text/javascript declaration from class-wc-abstract-
   google-analytics-js.php from line 51 or enqueue it with core’s inline script 
   actions? According to HTML5 and html validator “The type attribute is unnecessary
   for JavaScript resources”.
 * You enqueue the above script by echoing it, so the below function cannot affect
   it
 *     ```
          'after_setup_theme',
           function() {
               add_theme_support( 'html5', [ 'script', 'style' ] );
           }
       ```
   
 * Same applies to class-wc-google-analytics-js.php at 104, 175 and class-wc-google-
   analytics.php 414
 * A workaround could be something like the below:
 *     ```
       	$type_attr = current_theme_supports( 'html5', 'script' ) ? '' : ' type="text/javascript"';
       	?>
       	<script<?php echo $type_attr; ?>>
       	// ....
       	</script>
       ```
   
    -  This topic was modified 4 years, 9 months ago by [Web Expert](https://wordpress.org/support/users/seldimi/).
    -  This topic was modified 4 years, 9 months ago by [Web Expert](https://wordpress.org/support/users/seldimi/).

Viewing 1 replies (of 1 total)

 *  Plugin Support [Darcie](https://wordpress.org/support/users/darciemg/)
 * (@darciemg)
 * [4 years, 9 months ago](https://wordpress.org/support/topic/remove-text-javascript/#post-14812961)
 * Hi [@seldimi](https://wordpress.org/support/users/seldimi/)!
 * I see you’ve submitted this to the GitHub repo already here:
    [https://github.com/woocommerce/woocommerce-google-analytics-integration/issues/196](https://github.com/woocommerce/woocommerce-google-analytics-integration/issues/196)
 * Thanks for submitting that change! Our developers will take a look and reply 
   to you there.
 * I’ll mark this topic as solved for now. Please feel free to open a new topic 
   if you have any other questions.

Viewing 1 replies (of 1 total)

The topic ‘Remove text/javascript’ is closed to new replies.

 * ![](https://ps.w.org/woocommerce-google-analytics-integration/assets/icon-256x256.
   png?rev=3234358)
 * [Google Analytics for WooCommerce](https://wordpress.org/plugins/woocommerce-google-analytics-integration/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/woocommerce-google-analytics-integration/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/)
 * [Active Topics](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/woocommerce-google-analytics-integration/reviews/)

## Tags

 * [html5](https://wordpress.org/support/topic-tag/html5/)
 * [script](https://wordpress.org/support/topic-tag/script/)
 * [W3C](https://wordpress.org/support/topic-tag/w3c/)

 * 1 reply
 * 2 participants
 * Last reply from: [Darcie](https://wordpress.org/support/users/darciemg/)
 * Last activity: [4 years, 9 months ago](https://wordpress.org/support/topic/remove-text-javascript/#post-14812961)
 * Status: resolved