Installing W3 Total Cache with BulletProof Security Pro

Home Forums BulletProof Security Pro Installing W3 Total Cache with BulletProof Security Pro

Viewing 15 posts - 1 through 15 (of 63 total)
  • Author
  • #412
    AITpro Admin

    Email Question:

    I am thinking of installing a cache plug-in like W3 Total Cache. But I already have BulletProof Security Pro installed and activated. Is it as easy as deactivating and installing W3? Then reactivating BPS? W3 Total has so many options and I know it modifies the .htaccess files as well. I just want to make sure I do it right.  If you have any instructions or tips that would be great. Or if you think I should use a different plug-in because of better compatibility let me know.



    UPDATE: BPS Pro 13+ and BPS 2.0+ versions have a feature called: Setup Wizard AutoFix (AutoWhitelist|AutoSetup|AutoCleanup) that automatically creates plugin and theme whitelist rules and automatically sets up and cleans up caching plugins htaccess code.

    IMPORTANT NOTE:  If you have a WordPress Giving Its Own Directory (GWIOD) site then W3TC htaccess caching code goes in the site root htaccess file and not in the BPS root htaccess file or BPS Custom Code.  W3TC will automatically create that htaccess code in the site root htaccess file.  No further steps are required by you.

    Yes, W3 Total Cache writes .htaccess code to your root .htaccess file and also writes a line of code to your wp-config.php file.  Since these files are locked with F-Lock you will need to unlock them first to allow W3 Total Cache to write its code to these files.  Follow these procedural steps below to install W3 Total Cache on a website with BulletProof Security Pro already installed.

    1. BPS Pro: Turn off AutoRestore.
    2. BPS Pro: Go to F-Lock and unlock both your Root .htaccess file and your wp-config.php file.
    2. BPS free: Go to the htaccess File Editor page, click the Unlock htaccess File button and click the Turn Off AutoLock button.
    3. Go to the W3TC General Settings page and resave all of your W3TC settings.
    4. Go to the htaccess File Editor tab page > Your Current Root htaccess File tab > Copy the W3TC .htaccess code from your root htaccess file to this BPS Pro Custom Code text box: CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE.
    5. Click the Save Root Custom Code button.
    6. BPS Pro: Go to F-Lock and select the Lock Root .htaccess file option. Select Checking and Alerts Off option for the wp-config.php file and click the Save Options button.
    6. BPS free: Go to the htaccess File Editor page, click the Lock htaccess File button and click the Turn On AutoLock button.
    7. BPS Pro: Re-run the Pre-Installation Wizard and Setup Wizard.
    7. BPS free: Re-run the Setup Wizard.


    Firstly, may I just say what an incredibly thorough and impressive piece of work this Pro plugin is… mind blowing!
    Having just purchased the plugin yesterday I have installed it without any glitches at all. I have just followed your W3 TC instructions in this post and all worked perfectly. My question is that I wasn’t sure whether I needed to re-lock the Root .htaccess file and the wp-config.php file after the above process was completed, as it doesn’t instruct to do so? Maybe they need to remain un-locked for the W3 TC to work but I thought I ought to check.
    Many thanks for this really impressive piece of work.

    AITpro Admin

    oops I left that step out.  Thank you for letting me know about this.  I will add it right now.  

    These steps are only necessary for this exact scenario where you are installing W3TC for the first time on a website with BPS Pro already installed.  If you make any future caching setting changes in W3TC then W3TC will need to be able to write to your root .htaccess again and you can just use the unlock button on the BPS Edit/Upload/Download page to unlock your root .htaccess file.  Your root .htaccess file will be sent to Quarantine since the root .htaccess file is being modified outside of the BPS .htaccess editor so you will then just need to use the Restore File option in Quarantine to restore your root .htaccess when it is quarantined.  In normal daily website operation if you are not making any changes to W3TC then you will not have to do any additional steps or leave any files unlocked.


    Perfect! Many thanks for your fast response.

    AITpro Admin

    To save your W3TC cache code permanently so that any time in the future that you click the Root folder BulletProof Mode Activate button (copies the master .htaccess file to your website root folder) do these steps below:

    1. Copy your W3TC cache code to this BPS Custom Code text box:  CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE:
    IMPORTANT NOTE:  The order of custom code in this Custom Code text box is:  php/php.ini handler code (if your website uses a php/php.ini handler) and then W3TC caching code.
    2. Click the Save Root Custom Code button.
    3. Go to the BPS Security Modes page and click the Root Folder BulletProof Mode Activate button.


    I got that problem too, after some update i got the message that the website is not protected and i should create a new master .htaccess.

    I did that and then got the message :
    W3 Total Cache is activated, but W3TC htaccess code was NOT found in your root htaccess file. W3TC needs to be redeployed by clicking either the W3TC… I tried strep by step how you describe here, but it is still there. How is that possible? Where do i find the “W3TC caching code” which i can copy in the BPS Custom Code text box?

    Kind Regards

    AITpro Admin

    Many things have changed with W3TC so maybe you are not actually using or have any W3TC .htaccess code.  To make the error check go away do these steps.

    1.  Copy this text:  # W3TC Error Check to this BPS Custom Code text box:  
    2.  Click the Save Root Custom Code button.
    3. Go to the BPS Security Modes page and click the Root Folder BulletProof Mode Activate button.
    4.  Refresh your Browser and the Error Check should go away.


    Perfect that worked!


    Hi there,

    Just need an idiots guide for this please, as I’ve tried following the above steps but then panicked and uninstalled the W3 TC again and don’t know what to do with the quarantined files!

    So I have BPS Pro, and would now like to do a new install of W3 TC. I followed the steps at the start of this thread from 1 – 6 but didn’t know at what stage to do the exclude rules for the files below – could I do them as step #1 to ensure they are effective??:


    So now in my quarantined files it includes these files (each twice over), and as I’ve uninstalled the W3 Tc plugin I guess I should just delete them?:


    Could you list the steps exactly in order for the start to the end of setup for this install please as I’m really stuck now?

    Many thanks.

    Also I just remembered that what really floored me, was when looked for the W3 TC plugin .htaccess code in my Current Root .htaccess file it wasn’t there – so not sure what had happened, but it didn’t seem right – hence my uninstalling it eventually.

    AITpro Admin

    I just noticed that the link at the beginning of this Forum Topic had the wrong link for the AutoRestore/Quarantine Exclude Folders & Files video tutorial.  That link has been added above and I’ll post it again here:

    1. Turn Off AutoRestore first while setting up W3TC.
    2. Do the W3TC setup steps above to add the W3TC htaccess cache code to BPS Custom Code, activate Root folder BulletProof Mode and check that W3TC is working correctly.
    3. If everything is working correctly – run the Pre-Installation Wizard and Setup Wizard again.

    At a later time if you change your W3TC settings again then a couple of the W3TC files will be quarantined. Watch the AutoRestore/Quarantine Exclude Folders & Files video tutorial above for the steps to exclude W3TC files from being quarantined in the future.


    OK, well this has been a bit of a ‘journey’! Nothing seemed to go as you said above – not even the W3 TC htaccess code for copying etc. And it kept saying that it (W3 TC) couldn’t access my .htaccess file or wp-contents file, even though I’d unlocked them in the F-lock section…. until i realised that I’d tightened up the file permissions as much as possible when I’d first installed the free version a few months ago, so both the wp-content and the wp-content/uploads were at 705 and 755 respectively. Once I’d changed these both to 777 and tried to reload it seemed to be happier, plus then I think I found the correct W3 TC htaccess code in another place (but not in the root access file) and copied it in to the BPS custom code, plus added all the file exclusions in the ARQ section as above etc.

    So the long and the short of it is that it now seems to be all working, but there were 2 extra files that were quarantined, which BPS wouldn’t save as an excluded file – it would ONLY save it as an excluded folder. The files were:


    So I’ve saved the excluded folder as:

    Is this right?

    Also once finished, is the correct procedure: 1.full bulletproof procedure 2. F-lock to lock the root htaccess and wp-config.php again 3. Pre-Installation Wizard and Setup Wizard again?

    I’m afraid all is not well still – despite it seeming Ok, when I go to the W3 TC dashboard, I get this warning:
    FTP credentials don’t allow to write to file /home/xxx/public_html/
    W3 Total Cache Error: Files and directories could not be automatically created to complete the installation. View required Changes.

    And then I add in the replacement code to my BPS custom code in the top code block, save it, redo the magic bullet proof mode etc… But when i go back to the W3 dashboard again it keeps showing me different required code for the htaccess! So I now have got no idea what to do, as I’m just going around in circles! Should I completely uninstall and start from scratch, or am I missing something obvious?

    many thanks 🙂

    AITpro Admin

    I’m worried about this – “Once I’d changed these both to 777”.  You should never have to use 777 permissions so change that back immediately.  777 permissions allow anyone to write to a folder or file.  Create a temporary Administrator login to this website and send it to edward at ait-pro dot com and I will setup W3TC on this site and let you know, which step needed to be done.


    The reason I changed the file permissions is because that’s what the W3 TC installation instructions said they had to be (see and although that wasn’t in you instructions, and by unlocking with F-lock didn’t do it, i assumed that was one of the reasons it wasn’t installing correctly. But I’ve changed them all back again (via cPanel) as soon as I’d finished the W3 TC installation.

    I really appreciate your offer to look at it/install it (W3TC) for me, but I’d quite like to have another go at it, with your step by step instructions if possible, as I have another (more important) site to install it on too, so want to get it right on this one first! But if you think it will take too long to explain that’s fine and I’ll email you a login? Thanks.

    AITpro Admin

    The step by step instructions are already posted above so I am not sure what else you want me to post here?  I believe where the problem is occurring is when you are copying and pasting W3TC htaccess code to BPS Custom code.  At least that is where most people get a little lost.  Make sure your root .htaccess is unlocked and then deactivate and activate W3TC and resave your W3TC plugin settings.  What will happen is that W3TC will be able to write its htaccess code into the root .htaccess file.  Copy that W3TC htaccess code to the CUSTOM CODE TOP PHP/PHP.INI HANDLER/CACHE CODE text box and do the rest of the steps.


    Ok, I’m all clear on that. Do you think I should still need to change my file permissions to 777 (in cPanel) for the folders W3TC mention or just use the unlock in F-lock section?

Viewing 15 posts - 1 through 15 (of 63 total)
  • You must be logged in to reply to this topic.