Jesin's Blog

Welcome to the Portal of Technology

  • Facebook
  • GitHub
  • RSS
  • Twitter
  • Home
  • Categories
    • Domains
    • Linux
    • Networking
    • PHP
    • Virtualization
    • Web Design
    • Web Servers
    • Windows
  • WordPress Plugins
    • Custom Error Pages
    • HTTP Digest Authentication
    • Mailgun Email Validator
  • Toolbox
    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool
  • About Me
  • Contact Me
  • Sitemap
Home ›
PHP ›
W3 Total Cache Remove Footer

W3 Total Cache Remove Footer

July 4, 2011 PHP Jesin A 10 Comments

remove w3 total cache comment

The W3 Total Cache is a caching plugin for wordpress which improves the performance of your wordpress blog. When this plugin is activated it inserts a HTML comment into your code which looks like this

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using disk
Page Caching using disk (enhanced)
Database Caching using disk

Served from: www.example.com @ 2011-07-04 06:59:27 -->

If you wish to remove W3 Total Cache Footer follow my instructions.

The comment is generated from a function named ob_callback it is located in

/home/username/public_html/wp-content/plugins/w3-total-cache/lib/W3/Plugin/TotalCache.php

replace public_html with www or htdocs which ever is applicable to your web server. Open this file and locate the lines

if ($this->can_ob()) {
ob_start(array(
&$this,
'ob_callback'
));
}

Now comment out the lines inside the IF loop

if ($this->can_ob()) {
/*ob_start(array(
&$this,
'ob_callback'
));*/
}

Thats it now save the file and reload your wordpress blog now you won’t see the W3 Total Cache Footer code.

Related posts:

php category thumbnailapc.php Download How to customize the BuddyPress activation email Default ThumbnailPlease fix your WP.org Plugin screenshots php category thumbnailRedirecting WordPress archives to a page How to prevent WordPress comment Spam using JavaScript

Tags: php, wordpress

Comments

  1. Sam Ami says

    August 1, 2011 at 6:50 pm

    Was looking to minify every aspect of my site. So I thought I should remove those final comments generated by W3 and this article helped. Thanks.

    Reply
  2. Alberto says

    April 26, 2013 at 4:59 pm

    That’s for the information, very usefull because there was a problem with the W3 Total Cache

    Reply
  3. Ganesh says

    June 26, 2013 at 7:44 pm

    It is not working

    Reply
    • Jesin says

      June 27, 2013 at 9:02 pm

      Hi Ganesh,

      I checked your website, I think you want to remove the footer displayed at the bottom of your website which reads

      “Performance Optimization WordPress Plugins by W3 EDGE”

      if this is the case

      1. Login to your wordpress wp-admin
      2. From the left side menu navigate to Performance > Dashboard
      3. Under the box “Spread the word” next to “Link:” choose “Select one” from the drop down box.

      This will remove the footer.

      Reply
  4. Ganesh says

    June 27, 2013 at 9:38 pm

    Thanks For Reply

    Till does not work

    Reply
    • Jesin says

      June 27, 2013 at 10:17 pm

      Try clearing all Caches by going to Performance > Dashboard and click the “empty all caches” button.

      Reply
  5. Laurence says

    March 5, 2016 at 3:10 pm

    Isn’t this modifying the W3 core files? Wont it be back next time it updates?

    Reply
    • Jesin A says

      March 5, 2016 at 8:24 pm

      Yes, it will be back when the plugin is updated, but this plugin gets updated only once or twice a year (unless a security flaw is discovered).

      Have a look at the development log – https://plugins.trac.wordpress.org/log/w3-total-cache/

      Moreover the TotalCache.php file hasn’t been modified for a long time – https://plugins.trac.wordpress.org/log/w3-total-cache/trunk/lib/W3/Plugin/TotalCache.php

      If you find a better method to do this without editing the core files, do share it here.

      Reply
  6. Laurence Cope says

    March 7, 2016 at 4:01 pm

    I found how to do it properly this way:
    https://www.dylanbarlett.com/2014/01/disabling-w3-total-cache-footer-comment/

    No core files changed

    Reply
  7. Annapurna Agrawal says

    February 17, 2017 at 3:11 pm

    Hi,
    I want the W3TC footer. But i do not know for what reason, it doesn’t come for me. Can you please tell me why.

    Reply

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Get a wealth of information delivered to your inbox. Subscribe and never miss a single article.

  • Tutorials and howtos
  • Code, scripts and commands
  • Online Tools

* No spam, unsubscribe anytime

Hire Me

  • SSL installation and hardening (A+ on Qualys SSL test)
  • Apache & Nginx configuration
  • Email deliverability improvement (10/10 on Mail Tester & MailGenius)
  • WordPress customization, optimization and migration
  • and much more…

    Tools

    • DNS Lookup Tool
    • htdigest Generator Tool Online
    • htpasswd Generator Tool Online
    • HTTP Headers Lookup Tool
    • MD5 Encryption Tool
    • Open Port Check Tool
    • SHA-1 Encryption Tool
    • URL Encoding/Decoding Tool

    Nav

    • Home
    • About Me
    • Contact Me
    • Privacy Policy
    • Sitemap
    Vultr SSD VPS

    Creative Commons License
    Jesin's Blog by Jesin A is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License.
    Based on a work at websistent.com.