W3 Total Cache Plugin Can Get You Banned from Google AdSense

by on February 21st, 2011

W3 Total Cache is a popular caching plugin for wordpress powered blogs. I have been using it after I quit using WP Super Cache wordpress plugin. I had been satisfied with its performance ever since. I have also tried CDN with it. Its good. Makes your wordpress blog run faster. Recently TechMynd was landed into adsense blacklist and i was checking few things and this problem caught my eye. Generally whenever you are using a wordpress plugin, you should give importance to its options detail. You better be careful about what plugin you are using and what type of changes it makes on your blog coding and source. If you are not careful enough then W3 Total Cache plugin can get you banned from Google Adsense. Here is how:

Google mentions in its policies that you can not alter or modify the ads code in anyway. W3 Total Cache modifies your blog output source that crawlers and search engines read. Google Adsense uses javascript and there are comments and line breaks in the ads code. W3 Total Cache provides you options to minify css and js files, remove comments from js and css and remove line breaks in its minify settings page. Normally everybody would check those options to remove css and js comments and line breaks but what about if W3 Total Cache removes comments from js code of Google Ads?

That’s surely a policy violation. Surely you won’t do it intentionally but W3 Total Cache would do it for you happily if you allow it. By default those options are unchecked in W3 Total Cache.

W3 Total Cache > Minify > HTML minify settings, JS minify settings and CSS minify settings.

In my opinion do not minify javascript of your blog because Google Adsense code is in JS language. Do not remove comments and line breaks from js in W3 Total Cache.

This is a precaution. Some expert or W3 Total Cache developers would have answers. They have provided a box where you can put google_ad_client to let W3 Total Cache ignore the Google Adsense code area but they have written the following in there:


Its google_ad_client and not the google_ad_section_. Make sure you are careful with the Adsense policies and thoroughly revise all your wordpress plugins.

In this sense, WP Super Cache is better because it won’t confuse you with these issues and I have seen few recent improvements in WP Super Cache Plugin. TechMynd still serves pages using W3 Total Cache.

Have your say…

Let me clear that TechMynd was not banned due to W3 Total cache. TechMynd is using W3 Total Cache and its a nice plugin. All I wanted to get developers attention about an issue. Google AdSense team did not clear that why TechMynd was banned. They just told us they found any policy violation. They do not respond to appeal usually. We were looking for issues in site and we found that W3 Total Cache or other cache plugins can affect on your html code output. Just be careful while handling javascript and html output by using cache plugins. Our recommendation is to not use line breaks in html and comment removal in javascript code using cache plugins. Plugin Developers can help you more on this.
Remember: Ad code is almost always in javascript language, it has line breaks, it also has comments and its against ad network policy to modify that code in anyway.
Hope it clears.

9 Reviews

  1. Frederick Townes says:

    Can someone please give me the ability to perform some tests on their site to understand what settings and issues with them directly. This issue is very important to me. The best way to start the conversation is by making a bug submission from the support tab of the plugin or using the contact form on my web site (http://www.w3-edge.com/contact/).

  2. yackub says:

    dear friend. My cpc and revenue incresed dramatically after removing w3 total cache plugin. I removed it after i got a personalized message that adsense has got problem crawling cache pages. I not knowing much about it i removed the caching software itself. I think its a waste. It never increases speed of the page that much. Use the gzip option to speed the page. And see what performs best by using addons like yahoo yslow and pagespeed. You can see the difference. I didnt have to take much effort to enable gzip as it was provided by my hosting.

  3. Mixed says:

    hello good day. im new to this caching. id like to clarify if using wp-minify or w3-total-cache can make u get banned from any ad network.? searching it doesnt point me to what i need till i saw this. i saw Frederick Townes said something about not to minify the ads. I would like to know. Thanks

  4. Joost de Valk says:

    You’ve obviously well researched your stuff and you might even have a point, but I can’t really take a liking for your sensationalists headline though, might want to tone that down a bit.

    As for getting banned: I doubt Google would do that, but then, who am I to know what Google does or doesn’t do.

    • Hiroshi says:

      @Joost: I am sorry. I was carried away a bit after when I got banned. I’m okay now. I am not expert. Not an expert developer. I will change the heading shortly. I wanted to catch attention of senior developers and wanted to have answer for audience about the concern. I wanted to point out and get feed back about prospect of ‘line breaks’, ‘comment removal’ from javascript, where ads use javascript and Google says to not touch the code…
      researching…and revising post shortly…
      Thanks Joost!

  5. W3TC has options to respect HTML comments if you’re using AdSense (or supporting some screen readers etc). If there are some strings that someone would like added to the defaults, please let me know so everyone can benefit from your experience.

  6. Michael says:

    Thanks for the advisor! but I’ve not understand the solution…

    “They have provided a box where you can put google_ad_client to let W3 Total Cache ignore the Google Adsense code area but they have written the following in there:


    Its google_ad_client and not the google_ad_section_. ”

    Can you please tell exactly what I have to do in the W3 Total Cache’s Options Page?

    • Hiroshi says:

      @Michael: The thing is, you need to check how plugin will affect your blog before you use it. My recommendation is to not remove html line breaks and do not minify javascript. And add google_ad_client in the box where there is google_ad_section. Google says to do not modify the ad code in any way. Not even their search box code. You have to use that google logo which comes with search box otherwise you will violate their policy. So line breaks and javascript minification or javascript to footer can affect your ad code.

  7. Fahad says:

    Hi Hiroshi,

    It is very bad that you got blacklisted from Adsense. Thanks for the information regarding W3 as i am also using it.