Take the 2-minute tour ×

I am trying to configure W3 total cache plugin to speed up my site. The minify option is great but I am running into the following issue:
Let's say I have a JavaScript file I am attached wp_localize script() to and it's called 'additions.js'. Because W3TC minifies this JavaScript file and renames it, the wp_localize_script() function no longer sees my 'additions.js' file and the variables inside it don't get shared with it.
Does anyone have a solution for this? Let me know if anything is unclear.

share|improve this question
add comment

1 Answer

up vote 5 down vote accepted

W3 Total Cache has 4 locations to include the minified files. Since wp_localize_script() hooks into wp_head() (unless you specify in footer in your enqueue) you can use the before </body> minify location and your script will have access to the variables set. On some occasions this has failed for me so I just exclude the script from minify.

share|improve this answer
This seems to work. Thank you! –  Roman Epicnerd Sharf Jul 12 '12 at 3:05
add comment

Your Answer


