Title: DIVI THEME and AUTOPTIMIZE
Last modified: May 18, 2019

---

# DIVI THEME and AUTOPTIMIZE

 *  Resolved [bluelightwave](https://wordpress.org/support/users/bluelightwave/)
 * (@bluelightwave)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/)
 * what settings should be done when using DIVI and autoptimze together?
 *  i was having issues with displaying google fonts in one of my sites, but then
   unticked ‘also optimize for logged users’ and it worked. But then this didn’t
   work in my other site, so I had to disable ‘static css file generation’ on divi,
   and ticked ‘force javascript in <head>’ on autoptimze to work for a while, but
   then it didn’t??! I have just disabled autoptimize for now, and all shows up.
 * Are there any docs or chats where I can look into for the settings when these
   two work conjunction??
    -  This topic was modified 6 years, 12 months ago by [bluelightwave](https://wordpress.org/support/users/bluelightwave/).
    -  This topic was modified 6 years, 12 months ago by [bluelightwave](https://wordpress.org/support/users/bluelightwave/).
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fdivi-theme-and-autoptimize%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

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

 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 12 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11546790)
 * There’s not generic Divi+AO doc, as configuration depends not only on theme but
   also on theme config, plugins & plugin config really (which explains why working
   config on one of your sites did not work on anohter).
 * Given disabling “static CSS file generation” helped, I would go from there. Regarding
   JS issues; what broke & when? What JS errors were visible on the browser console?
 *  Thread Starter [bluelightwave](https://wordpress.org/support/users/bluelightwave/)
 * (@bluelightwave)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11600615)
 * I am back working on this issue, and not sure where to go now… how would i go
   about seeing JS errors in browser console?
    For now I have disable autoptimze,
   since this is the only way my webpage displays as it should…but would like to
   install autoptimize for all the benefits it has 😉
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11601124)
 * have a look at [https://wordpress.org/support/article/using-your-browser-to-diagnose-javascript-errors/#step-3-diagnosis](https://wordpress.org/support/article/using-your-browser-to-diagnose-javascript-errors/#step-3-diagnosis)
   re. JS errors
 * re. disabling AO; you can always activate the features that don’t break your 
   site (HTML optimization, CSS optimization?, Google Fonts, Images, …)?
 * frank
 *  Thread Starter [bluelightwave](https://wordpress.org/support/users/bluelightwave/)
 * (@bluelightwave)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11605640)
 * So I disable aggragate JS-files and page displays now as it should…
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11606453)
 * OK, that’s a good start! so when JS aggregation is on, what errors do you see
   on the browser console?
 *  Thread Starter [bluelightwave](https://wordpress.org/support/users/bluelightwave/)
 * (@bluelightwave)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11608319)
 * SyntaxError: missing } after try block autoptimize_6149df3f2a1f6738f16d8d5c2cfa1411.
   js:1084:2411
    uncaught exception: TagError: adsbygoogle.push() error: Only one‘
   enable_page_level_ads’ allowed per page.
 *  Thread Starter [bluelightwave](https://wordpress.org/support/users/bluelightwave/)
 * (@bluelightwave)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11608337)
 * and when I disable i get this:
    ReferenceError: wp is not defined autoptimize_single_81f5cbe986afdc84c8480d9a27ae9b2d.
   js:1:161688 <anonymous> [https://food4youngathletes.com/wp-content/cache/autoptimize/js/autoptimize_single_81f5cbe986afdc84c8480d9a27ae9b2d.js:1](https://food4youngathletes.com/wp-content/cache/autoptimize/js/autoptimize_single_81f5cbe986afdc84c8480d9a27ae9b2d.js:1)
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11608407)
 * OK, can you;
    * disable JS try/catch wrapping * add `/plugins/wp-ultimate-recipe/`(
   which is responsible for that `wp is not defined` error) to the comma-separated
   JS optimization exclusion list * disable the minification of non-aggregated (
   excluded) files
 * And then check what JS errors are visible (you’ll still see the wp is not defined
   one, but that’s something AO can’t fix)?
 *  Thread Starter [bluelightwave](https://wordpress.org/support/users/bluelightwave/)
 * (@bluelightwave)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11610310)
 * so I enable aggregate js-files to be able to disable js try/catch wrapping. Added
   the /plugins/wp-ultimate-recipe/ to list and unticked ‘minify excluded css and
   Js files’
    and got the following errors, and page goes back to displaying with
   blank areas…
 * JQMIGRATE: Migrate is installed, version 1.4.1 autoptimize_e210ce4e1046bec374ee2a0a0e9a4d6c.
   js:2:552
    TypeError: document.body is null autoptimize_e210ce4e1046bec374ee2a0a0e9a4d6c.
   js:271:50 <anonymous> [https://food4youngathletes.com/wp-content/cache/autoptimize/js/autoptimize_e210ce4e1046bec374ee2a0a0e9a4d6c.js:271](https://food4youngathletes.com/wp-content/cache/autoptimize/js/autoptimize_e210ce4e1046bec374ee2a0a0e9a4d6c.js:271)
   <anonymous> [https://food4youngathletes.com/wp-content/cache/autoptimize/js/autoptimize_e210ce4e1046bec374ee2a0a0e9a4d6c.js:271](https://food4youngathletes.com/wp-content/cache/autoptimize/js/autoptimize_e210ce4e1046bec374ee2a0a0e9a4d6c.js:271)
   uncaught exception: TagError: adsbygoogle.push() error: Only one ‘enable_page_level_ads’
   allowed per page. ReferenceError: wp is not defined wpurp-public.js:1:161688 
   <anonymous> [https://food4youngathletes.com/wp-content/plugins/wp-ultimate-recipe/assets/wpurp-public.js:1](https://food4youngathletes.com/wp-content/plugins/wp-ultimate-recipe/assets/wpurp-public.js:1)
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11610575)
 * OK, so document.body is used in multiple JS-files, so not _very_ straightforward,
   but you would have to try to exclude these one by one to see which one causes
   the error;
 * ![](https://i0.wp.com/pix.toile-libre.org/upload/original/1559803709.jpg)
 * for the “adsbygoogle”-error you’ll have to untick “also aggregate inline JS” 
   or add `adsbygoogle` to the JS optimization exclusion list.
 * frank
 *  Thread Starter [bluelightwave](https://wordpress.org/support/users/bluelightwave/)
 * (@bluelightwave)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11612514)
 * I have excluded /plugins/wp-ultimate-recipe/,adsbygoogle,/themes/Extra/includes/
   builder/scripts/frontend-builder-scripts.js,
 * I noticed that another of pages was not displaying correctly so I excluded the
   following and it fixed this specific problem on the page – /wp-content/plugins/
   wp-ultimate-recipe/assets/wpurp-public.js
 * Unticked aggregate js-files
 * seems to be working better now
 *  Plugin Author [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * (@optimizingmatters)
 * [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11612772)
 * If you can make it work with “aggregate JS files” on and “aggregate inline JS”
   off, that would be better though (from a page rendering performance point of 
   view).

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

The topic ‘DIVI THEME and AUTOPTIMIZE’ 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

 * [divi](https://wordpress.org/support/topic-tag/divi/)
 * [Extra Theme](https://wordpress.org/support/topic-tag/extra-theme/)

 * 12 replies
 * 2 participants
 * Last reply from: [Optimizing Matters](https://wordpress.org/support/users/optimizingmatters/)
 * Last activity: [6 years, 11 months ago](https://wordpress.org/support/topic/divi-theme-and-autoptimize/#post-11612772)
 * Status: resolved