Title: Optimize JavaScript Code? hides featured images
Last modified: July 14, 2022

---

# Optimize JavaScript Code? hides featured images

 *  Resolved [samvancook](https://wordpress.org/support/users/samvancook/)
 * (@samvancook)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/)
 * The page linked is just an example. Any page with a featured image has an issue.
 * They are currently being shown because I have the “Optimize JavaScript Code?”
   box un-checked, which fixes the issue.
 * I have checked the console for errors and gone through these notes: [https://blog.futtta.be/2022/05/05/what-to-do-when-autoptimize-breaks-your-site/](https://blog.futtta.be/2022/05/05/what-to-do-when-autoptimize-breaks-your-site/)
 * without any luck.
 * I have a staging site set up and a similar link on that staging site shows the
   issue in action:
 * [https://staging-buttonpoetry.kinsta.cloud/blythe-baird-taking-my-mother-to-a-gay-bar-250k-views/](https://staging-buttonpoetry.kinsta.cloud/blythe-baird-taking-my-mother-to-a-gay-bar-250k-views/)
 * Thanks folks!
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Foptimize-javascript-code-hides-featured-images%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15826329)
 * Hey Sam;
    can you try excluding `wp-content/themes/Button-Theme/dist/assets/js/
   app.js` from JS optimization?
 * hope this helps,
    frank
 *  Thread Starter [samvancook](https://wordpress.org/support/users/samvancook/)
 * (@samvancook)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15826355)
 * Amazing! Solved in under an hour. Very impressed! Thanks!
 *  Thread Starter [samvancook](https://wordpress.org/support/users/samvancook/)
 * (@samvancook)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15826357)
 * Whoops. Resolved!
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15826364)
 * You’re welcome Sam, feel free to [leave a review of the plugin and support here](https://wordpress.org/support/plugin/autoptimize/reviews/#new-post)!
   🙂
 *  Thread Starter [samvancook](https://wordpress.org/support/users/samvancook/)
 * (@samvancook)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15826414)
 * Apparently I spoke too soon. I thought it was fixed but I’m back to inconsistent
   behavior where the featured images appear sometimes and don’t others.
 * In general if the appear when I first navigate to a site they ‘disappear’ if 
   I refresh.
 * This same page displays the above behavior for me:
 * [https://buttonpoetry.com/blythe-baird-what-a-body-inherits-after-hieu-minh-nguyen-100k-views/](https://buttonpoetry.com/blythe-baird-what-a-body-inherits-after-hieu-minh-nguyen-100k-views/)
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15827206)
 * Morning Sam. Let’s take a step back; does this also happen when “optimize JavaScript”
   is off entirely?
 *  Thread Starter [samvancook](https://wordpress.org/support/users/samvancook/)
 * (@samvancook)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15857758)
 * Nope. If I turn it off “optimize JavaScript” altogether the featured images show
   up.
 * Additionally I got an update from the folks at shortpixel and they said:
 *     ```
       I just verified your website and ran some more checks and it looks like this problem actually persists if the Eliminate render-blocking CSS under Optimize CSS Code feature in Autoptimize is active, while our plugin SPAI is also active. You can try disabling this option to see that your feature images is displayed correctly if so.
   
       I'm pretty sure this is just a minor conflict and should be easily fixed by adding an exception in Autoptimize's plugin settings. In the thread you opened on Autoptimize support forum on WordPress, you can let their team know about this and see if they come up with a solution instead of disabling the feature.
       ```
   
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15857819)
 * OK, so the image show up both if “optimize JS” is off but also when “remove render-
   blocking CSS” is off?
 *  Thread Starter [samvancook](https://wordpress.org/support/users/samvancook/)
 * (@samvancook)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15857846)
 * Yep either seem to produce the desired behavior for the featured images.
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15857862)
 * OK and does this also happen when SPAI is not used?
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15857874)
 * Additional question (and then I’m off to bed); do you have pages on staging (
   or live) where this is happening?

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

The topic ‘Optimize JavaScript Code? hides featured images’ 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/)

 * 11 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [3 years, 10 months ago](https://wordpress.org/support/topic/optimize-javascript-code-hides-featured-images/#post-15857874)
 * Status: resolved