How to add an auto_prepend_file php option (Wordfence)

cPanel >> Software >> Select PHP Version

This article is written in particular reference to Wordfence (a Wordpress security plugin), but the same principle applies for any requirement to add an auto_prepend_file.

In order to enable Extended Protection in the Wordfence firewall it is necessary to set the auto_prepend_file php option.  Whilst Wordfence attempts to do this automatically you will need to perform these additional steps to complete the process.

1. In Wordpress, within Wordfence >> Firewall, click the blue 'Optimise the Wordfnce Firewall' button and copy the full path to the wordfence.waf file - it'll be between single quotes and look something like '/home/example/public_html/wordfence-waf.php'

2. Login to cPanel for the domain

3. Click 'Select PHP Version' from the Software section

4. Click 'Switch to PHP Options' at the top right

5. Locate the auto_prepend_file option and click to the right; by default this will say 'None', delete this and paste the path required here.  It should look like the image below, but with the full path to your file.

auto_prepend_file

6. Click 'Apply' and then click 'Save' at the bottom.

7. Return to Wordpress and refresh the Wordfence firewall page - it should now show 'Extended Protection' 

  • auto_prepend_file php
  • 1 Users Found This Useful
Was this answer helpful?

Related Articles

Validate promo code during new order

For the validation of promo code during order, please follow the steps below:1.  Go on the...

How can I move my WordPress site to OBHost Hosting ?

Make a full WordPress Transfer A WordPress migration from your existing provider to OBHost is...

How do I move my WordPress site from one folder to another?

We often receive support requests where customers have installed WordPress into a subdirectory...

What file and directory permissions should I use for my web files?

Files Files should always be uploaded and set to chmod 644. The ONLY important exceptions to...

WordPress Multi Site FAQ

1. What is WordPress Multisite (WPMU)WordPress Multisite (or Wordpress MultiUser (WPMU)) is a...