Title: Firewall Optimization Setup
Last modified: February 6, 2026

---

# Firewall Optimization Setup

 *  Resolved [remifiat](https://wordpress.org/support/users/remifiat/)
 * (@remifiat)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/firewall-optimization-setup-3/)
 * Hello
 * Help would be kindly accepted since I can’t get Firewall Optimization Setup to
   complete
   When “Optimize the wordfence firewall” is selected, offers the following
   web server’s configuration : Apache + CGI/Fast CGI (which I checked on the server
   is appropriate)Save backup for .htaccess and .user.ini filesClick on continueMessage
   says everything went fine but it can take some time to appear as complete : it
   never does
 * I had a look in the .htaccess and .user.ini files and wordfence has added some
   instructions allright
 * Checked the auto_prepend_file in the diagnosics and it’s directing to the right
   folder
 * Asked the server’s hotline (host is LWS) if they have any know issues with Wordfence
   but they tell me that they don’t and that they runned a check on my website, 
   they confirmed that Wordfence modified the files without problems
 * I read the Wordfence help and tried a few things but I can’t get the Optimisation
   to complete
 * So if anyone has an idea ? Please ?
 * Last question : the Firewall is still in learning mode, can it interfere with
   the optimisation ?
 * Many thanks
 * Rémi
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffirewall-optimization-setup-3%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Support [wfmargaret](https://wordpress.org/support/users/wfmargaret/)
 * (@wfmargaret)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/firewall-optimization-setup-3/#post-18813064)
 * Hi Rémi,
 * Thanks for reaching out! Learning Mode would not interfere with the firewall 
   optimization.
 * Can you send a diagnostic report to **wftest @ wordfence . com**? You can find
   the link to do so at the top of the **Wordfence > Tools > Diagnostics** page.
   Then click on “**Send Report by Email**”. Please add your forum username where
   indicated and _respond here after you have sent it._
 * **NOTE:** It should look as follows – Screenshot of [Tools > Diagnostic > Send by Email](https://www.wordfence.com/wp-content/uploads/2021/09/diagnosticsendbyemail.png)
 * Thanks,
   Margaret
 *  Thread Starter [remifiat](https://wordpress.org/support/users/remifiat/)
 * (@remifiat)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/firewall-optimization-setup-3/#post-18813460)
 * Hi Margaret
 * Thank you for your prompt reply
 * The diagnostic was send by e-mail with my username where indicated
 * Regards
 * Rémi
 *  Plugin Support [wfmargaret](https://wordpress.org/support/users/wfmargaret/)
 * (@wfmargaret)
 * [3 months, 2 weeks ago](https://wordpress.org/support/topic/firewall-optimization-setup-3/#post-18815222)
 * Hi Rémi,
 * Thanks for sending the diagnostics. I can see that the auto_prepend_file directive
   is correctly set in your .user.ini file, but it’s not being reflected in the 
   actual PHP configuration. This means something on LWS’s server is preventing 
   the value from being set.
 * I’d recommend contacting LWS and letting them know that you need the **auto_prepend_file**
   PHP directive to be set to the path of the **wordfence-waf.php** file in your
   WordPress root directory. They may be able to update that for you manually or
   point you to where it needs to be updated.
 * For more details on this, here’s the relevant troubleshooting page:
   [https://www.wordfence.com/help/firewall/optimizing-the-firewall/troubleshooting/](https://www.wordfence.com/help/firewall/optimizing-the-firewall/troubleshooting/)
 * Let us know how it goes!
 * Thanks,
   Margaret

Viewing 3 replies - 1 through 3 (of 3 total)

You must be [logged in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Ffirewall-optimization-setup-3%2F%3Foutput_format%3Dmd&locale=en_US)
to reply to this topic.

 * ![](https://ps.w.org/wordfence/assets/icon.svg?rev=2070865)
 * [Wordfence Security - Firewall, Malware Scan, and Login Security](https://wordpress.org/plugins/wordfence/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wordfence/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wordfence/)
 * [Active Topics](https://wordpress.org/support/plugin/wordfence/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wordfence/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wordfence/reviews/)

 * 3 replies
 * 2 participants
 * Last reply from: [wfmargaret](https://wordpress.org/support/users/wfmargaret/)
 * Last activity: [3 months, 2 weeks ago](https://wordpress.org/support/topic/firewall-optimization-setup-3/#post-18815222)
 * Status: resolved