Title: Autoptimize breaks all print plugins using javascript
Last modified: May 10, 2017

---

# Autoptimize breaks all print plugins using javascript

 *  Resolved [ximin](https://wordpress.org/support/users/ximin/)
 * (@ximin)
 * [9 years ago](https://wordpress.org/support/topic/autoptimize-breaks-all-print-plugins-using-javascript/)
 * Autoptimized does not work with any other print plugins, every time the ‘Optimize
   JavaScript Code’ is enabled, it remove the print plugin .js files, I used ‘WP-
   Print’, ‘
    Print-O-Matic’ etc none of them work with autoptimize

Viewing 7 replies - 1 through 7 (of 7 total)

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years ago](https://wordpress.org/support/topic/autoptimize-breaks-all-print-plugins-using-javascript/#post-9116309)
 * well, as per the troubleshooting tips in [the FAQ](https://wordpress.org/plugins/autoptimize/faq/);
   have you tried excluding those scripts from optimization?
 *  Thread Starter [ximin](https://wordpress.org/support/users/ximin/)
 * (@ximin)
 * [9 years ago](https://wordpress.org/support/topic/autoptimize-breaks-all-print-plugins-using-javascript/#post-9116561)
 * hi, thanks for the reply,
 * yes it is possible to exclude the script and it works,
 * but is there anyway to make it work without excluding the script?
 * seems that javascript that does DOM modifications like hiding showing etc will
   be removed
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years ago](https://wordpress.org/support/topic/autoptimize-breaks-all-print-plugins-using-javascript/#post-9116581)
 * that depends on the print javascript AND on your AO config actually.
 * if you can link to a page what has autoptimize + non-excluded print-javascript,
   I’d be happy to have a look 🙂
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years ago](https://wordpress.org/support/topic/autoptimize-breaks-all-print-plugins-using-javascript/#post-9116643)
 * but autoptimize isn’t active [@ximin](https://wordpress.org/support/users/ximin/),
   so I can’t see what is going wrong there?
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years ago](https://wordpress.org/support/topic/autoptimize-breaks-all-print-plugins-using-javascript/#post-9116654)
 * seems printing doesn’t work even if AO JS optimization is off; the resulting 
   page has a logo but no recipe? some JS-errors also on the print-page;
 * > TypeError: document.getElementById(…) is null[Learn More] print-posts-header.
   > js:7:3
   >  ReferenceError: jQuery is not defined[Learn More] print:2:14 ReferenceError:
   > jQuery is not defined[Learn More] print-posts-before-body-end.js:6:2 ReferenceError:
   > pagespeed is not defined[Learn More]
 *  Thread Starter [ximin](https://wordpress.org/support/users/ximin/)
 * (@ximin)
 * [9 years ago](https://wordpress.org/support/topic/autoptimize-breaks-all-print-plugins-using-javascript/#post-9117364)
 * hi, I have removed some of the errors
 * the other errors are from the ads and pagespeed,
 * the console shows ‘Uncaught SyntaxError: Unexpected end of input’
 * for autoptimize, around:
 * try{document.getElementById(“Recipe_loader”).innerHTML=document.getElementById(“
   Recipe”).innerHTML
 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [9 years ago](https://wordpress.org/support/topic/autoptimize-breaks-all-print-plugins-using-javascript/#post-9117778)
 * OK, I see you have AO active now, but all seems to work OK, even if the only 
   excluded JS is `themes/queenbee_v4/js/print-posts-before-body-end.js`?

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Autoptimize breaks all print plugins using javascript’ 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/)

## Tags

 * [javascript](https://wordpress.org/support/topic-tag/javascript/)

 * 7 replies
 * 0 participants
 * Last reply from: [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * Last activity: [9 years ago](https://wordpress.org/support/topic/autoptimize-breaks-all-print-plugins-using-javascript/#post-9117778)
 * Status: resolved