Title: Compatibility with WP Rocket
Last modified: August 24, 2016

---

# Compatibility with WP Rocket

 *  [lutechi](https://wordpress.org/support/users/lutechi/)
 * (@lutechi)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/compatibility-with-wp-rocket/)
 * Hello Frank,
 * I decided to test WP Rocket as a cache and it is pretty fast but their optimization
   is not as good as yours.
 * So I tried to combine plugins but is throwing some errors on the front-end whenever
   I enable Autoptimize.
 * This is the error:
 * `jQuery(document).ready(function() { var imgs, i, w; var imgs = document.getElementsByTagName('
   img' ); for( i = 0; i < imgs.length; i++ ) { w = imgs[i].getAttribute( 'width');
   imgs[i].removeAttribute( 'width' ); imgs[i].removeAttribute( 'height' ); } });`
 * I even put the initialize earlier but still the same.
 * I did not enable any optimizations on their cache plugin.
 * I can email you the link of the site if you wish.
 * Thanks again!
 * [https://wordpress.org/plugins/autoptimize/](https://wordpress.org/plugins/autoptimize/)

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

 *  Plugin Author [Frank Goossens](https://wordpress.org/support/users/futtta/)
 * (@futtta)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/compatibility-with-wp-rocket/#post-6072852)
 * Hi Lutechi;
    Haven’t tested wp rocket myself yet, so can’t give you simple answers
   I’m afraid, but here’s a few tips & remarks;
 * * the error isn’t an error, it’s jQuery-based javascript code to remove width
   and height from all images. where do you see that code?
    * if that code threw
   an error: you’ll have to exclude jquery.js from js optimization. * the best approach
   would be to autoptimize the site first and once that works enable wp-rocket to
   see at what moment things break and troubleshoot at that point.
 * Hope this helps,
    frank
 *  Thread Starter [lutechi](https://wordpress.org/support/users/lutechi/)
 * (@lutechi)
 * [11 years, 2 months ago](https://wordpress.org/support/topic/compatibility-with-wp-rocket/#post-6073000)
 * Thanks Frank for the quick response and tips. I will try it later and see what
   happens.
 * It was printing it at the top of every page like a debug error message.

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

The topic ‘Compatibility with WP Rocket’ 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

 * [compatibility](https://wordpress.org/support/topic-tag/compatibility/)
 * [WP Rocket](https://wordpress.org/support/topic-tag/wp-rocket/)

 * 2 replies
 * 2 participants
 * Last reply from: [lutechi](https://wordpress.org/support/users/lutechi/)
 * Last activity: [11 years, 2 months ago](https://wordpress.org/support/topic/compatibility-with-wp-rocket/#post-6073000)
 * Status: not resolved