Title: Exclude application/json scripts from minification?
Last modified: July 14, 2020

---

# Exclude application/json scripts from minification?

 *  Resolved [Hector Cabrera](https://wordpress.org/support/users/hcabrera/)
 * (@hcabrera)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/exclude-application-json-scripts-from-minification/)
 * Hi Raul,
 * Is there any chance Fast Velocity Minify could exclude `application/json` scripts
   from the minification process?
 * WordPress Popular Posts version 5.2 injects a `application/json` script into `
   <head>` that contains a JSON string, for example:
 *     ```
       <script type="application/json" id="wpp-json"
       {"sampling_active":0,"sampling_rate":"100","ajax_url":"https:\/\/www.example.com\/wp-json\/wordpress-popular-posts\/v1\/popular-posts","ID":false,"token":"a787dd82b4","lang":null,"debug":true}
       </script>
       ```
   
 * When Fast Velocity Minify is active, this inline `application/json` script is
   apparently bundled with the rest of the minified code, breaking WordPress Popular
   Posts’ ability to track pageviews, load widgets, etc.
 * `application/json` script tags should be safe to ignore as the browser doesn’t
   execute any code (they’re just JSON strings) and won’t load (external) JS files
   either.
 * Other solutions I tested (like Autoptimize) do seem to ignore these `<script 
   type="application/json">...</script>` tags so I’m hoping you could implement 
   this as well.
 * Thanks in advance!

Viewing 1 replies (of 1 total)

 *  Plugin Author [Raul P.](https://wordpress.org/support/users/alignak/)
 * (@alignak)
 * [5 years, 10 months ago](https://wordpress.org/support/topic/exclude-application-json-scripts-from-minification/#post-13127552)
 * That is because, the plugin doesn’t know if the script is json or whatever. It
   captures the file and it’s dependencies.
 * Other plugins, they capture the html instead of looking at the $wp_scripts variable,
   and that’s why they can filter those out. They also use a list of keywords that
   should not be merged in some situations.
 * I’ll look into this and for the next update, I should have a solution for this.
   
   Thanks for reporting
 * For now, you would have to add the parent js file to the ignore list, and then
   the code dependency won’t be merged as well.

Viewing 1 replies (of 1 total)

The topic ‘Exclude application/json scripts from minification?’ is closed to new
replies.

 * ![](https://ps.w.org/fast-velocity-minify/assets/icon-128x128.jpg?rev=1440946)
 * [Fast Velocity Minify](https://wordpress.org/plugins/fast-velocity-minify/)
 * [Support Threads](https://wordpress.org/support/plugin/fast-velocity-minify/)
 * [Active Topics](https://wordpress.org/support/plugin/fast-velocity-minify/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/fast-velocity-minify/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/fast-velocity-minify/reviews/)

## Tags

 * [fvm](https://wordpress.org/support/topic-tag/fvm/)
 * [inline script](https://wordpress.org/support/topic-tag/inline-script/)
 * [json](https://wordpress.org/support/topic-tag/json/)

 * 1 reply
 * 2 participants
 * Last reply from: [Raul P.](https://wordpress.org/support/users/alignak/)
 * Last activity: [5 years, 10 months ago](https://wordpress.org/support/topic/exclude-application-json-scripts-from-minification/#post-13127552)
 * Status: resolved