WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

closed as off-topic by Pieter Goosen, ialocin, birgire, Rarst Aug 27 '14 at 12:15

This question appears to be off-topic. The users who voted to close gave this specific reason:

If this question can be reworded to fit the rules in the help center, please edit the question.

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.