WordPress add WordFence firewall prepend setting to Siteground

Manually creating a php.ini in html home did not enable Wordfence firewall, had to do the steps below.

That procedure created a php.ini in the public html folder




SiteGround and other hosts without .user.ini support

If the “Click here to configure” button still appears after completing setup and waiting about 5 minutes, your host may not use the typical configuration files, such as .user.ini.

On SiteGround other other similar hosts that use cPanel:

  1. After attempting the installation, click the “Click here to configure” button again
  2. Look at the line that says something like: auto_prepend_file = ‘/home/username/public_html/wordfence-waf.php’
  3. Copy the “path” that appears between the quotes – yours will be different. In this example: /home/username/public_html/wordfence-waf.php
  4. Go to your site’s cPanel, and click the PHP Variables Manager icon
  5. Click the link that says “public_html”
  6. Enter “auto_prepend_file” as the variable name, click the “Add” button, and then paste the path that you copied
  7. Turn on the checkbox “Apply changes to all sub-directories” and click Save

If the site will not load properly, check the path you pasted to be sure there are no extra letters, quotes, slashes, etc. in the PHP Variables Manager. If it still will not work, you can try deleting the path and saving the settings, to return the site to its previous state and try again.