Title: Problems with autoptimize
Last modified: September 14, 2020

---

# Problems with autoptimize

 *  [shoppa](https://wordpress.org/support/users/shoppa/)
 * (@shoppa)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/problems-with-autoptimze/)
 * Hello, I found only one topic with autoptimize. So it seems to work for most 
   people. Unfortunately not for me.
 * I had to exclude these two things in autoptimize to make it work:
    wp-includes/
   js/jquery/jquery.js, wp-content/plugins/osm/
 * Otherwise JS errors would be visible in the console and the map would not appear.
   
   Can anyone confirm this problem?
 * Cheers
    Frank
    -  This topic was modified 5 years, 8 months ago by [shoppa](https://wordpress.org/support/users/shoppa/).

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

 *  Plugin Author [MiKa](https://wordpress.org/support/users/photoweblog/)
 * (@photoweblog)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/problems-with-autoptimze/#post-13406762)
 * Hello Frank,
 *  did you also try to exclude only the osm directory and not te jquery?
 * Br, MiKA
 *  Thread Starter [shoppa](https://wordpress.org/support/users/shoppa/)
 * (@shoppa)
 * [5 years, 8 months ago](https://wordpress.org/support/topic/problems-with-autoptimze/#post-13467330)
 * Hello, sorry for late response.
    Problem for me is, if i exlude nothing the JS
   error means in frontend ol is undefined and in backend the map is not visible.
 * In autoptimize is the checkbox for loading js in head unchecked.
    Only if i check
   this box it works. But you know scripts should better load before end body, not
   in head.
 * Is there a way to load your js later?
    I mean the part with <script type=”text/
   javascript”>/** all layers have to be in this global array…
 * If i only exclude osm (not jquery) then is jQuery undefined for this line:
    `
   jQuery(document).ready(function(){jQuery('.generatedLink').click(function(){if(
   jQuery(this).data('map_name')==''){jQuery(this).data('map_name',jQuery(this).
   data('map'));}`
 * cheers
    shoppa
    -  This reply was modified 5 years, 8 months ago by [shoppa](https://wordpress.org/support/users/shoppa/).
    -  This reply was modified 5 years, 8 months ago by [shoppa](https://wordpress.org/support/users/shoppa/).

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

The topic ‘Problems with autoptimize’ is closed to new replies.

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

 * 2 replies
 * 2 participants
 * Last reply from: [shoppa](https://wordpress.org/support/users/shoppa/)
 * Last activity: [5 years, 8 months ago](https://wordpress.org/support/topic/problems-with-autoptimze/#post-13467330)
 * Status: not resolved