Title: Exclude scripts with *
Last modified: January 14, 2025

---

# Exclude scripts with *

 *  [danhunt](https://wordpress.org/support/users/danhunt/)
 * (@danhunt)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/exclude-scripts-with-2/)
 * I need to exclude some scripts in order to get the cookieyes plugin working correctly
   alongside autoptimize. One of these is “client_data/(.*)/script.js” but it doesn’t
   accept the * and gives the error “please match the format requested”.
 * How would I exclude this script? Thanks

Viewing 1 replies (of 1 total)

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [1 year, 5 months ago](https://wordpress.org/support/topic/exclude-scripts-with-2/#post-18243269)
 * Autoptimize indeed does not support wildcards like that, `client_data/` would
   exclude every JS in that directory (and below), `/script.js` would exclude all
   JS with that exact filename, so you’ll have to play the most specific string 
   possible that matches the path.
 * as an alternative; if you control the way the script is added (enqueued) in WordPress,
   you could add the `data-noptimize` attribute to the script tag and it would be
   excluded as well?
 * hope this helps,
    frank

Viewing 1 replies (of 1 total)

The topic ‘Exclude scripts with *’ is closed to new replies.

 * ![](https://ps.w.org/autoptimize/assets/icon-256X256.png?rev=2211608)
 * [Autoptimize](https://wordpress.org/plugins/autoptimize/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/autoptimize/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/autoptimize/)
 * [Active Topics](https://wordpress.org/support/plugin/autoptimize/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/autoptimize/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/autoptimize/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [1 year, 5 months ago](https://wordpress.org/support/topic/exclude-scripts-with-2/#post-18243269)
 * Status: not resolved