If your WordPress website suddenly stops loading, keeps spinning, or shows a blank page with no error message, the Wordfence security plugin's firewall may be the cause. This article explains how to check for it and how to fix it.
Signs this is the problem
- Your website keeps loading and eventually times out, or shows a blank page, with no error message.
- Your hosting resource usage (CPU, memory, processes and disk) is within your plan's limits.
- Other services on your account, such as cPanel and webmail, work normally.
- Your site uses the Wordfence plugin.
Why it happens
When Wordfence's firewall is set up in "Extended Protection" mode, it adds a section to your site's .htaccess file, marked # Wordfence WAF. That section tells the server to load Wordfence's firewall file, wordfence-waf.php, before every page. If that file or the firewall data it relies on gets stuck, every page waits on it and the website never finishes loading.
Before you start: back up your .htaccess file
- Log in to cPanel and open File Manager.
- Click Settings (top right), tick Show Hidden Files (dotfiles) and click Save. If you can't see your
.htaccessfile, see How to Find the Missing htaccess File? - Open your website's folder (usually
public_html), right-click.htaccessand choose Copy. Save the copy as.htaccess-backup.
How to check
Temporarily rename .htaccess to .htaccess-test and reload your website. If the site loads (even if some links or pages look wrong), the problem is in the .htaccess file. Rename it back to .htaccess before you continue.
How to fix it
- Disable the Wordfence lines. Edit
.htaccessand find the# Wordfence WAFsection. Comment out or remove the two lines that start withphp_value auto_prepend_file. One sits inside the<IfModule LiteSpeed>block and the other inside the<IfModule lsapi_module>block. To comment out a line, add a#at the start of it. Save the file and check that your website loads. - Check the Wordfence plugin. Log in to WordPress and make sure Wordfence is still installed and up to date. Also check that the
wordfence-waf.phpfile in your website's folder hasn't been changed unexpectedly. - Clear Wordfence's firewall data. In File Manager, open the
wp-content/wflogs/folder and delete the.phpfiles inside it. Wordfence rebuilds these files automatically. - Turn the firewall back on the right way. Once your site is working, re-enable Wordfence's firewall from inside WordPress by going to Wordfence > Firewall > Optimize the Wordfence Firewall. Avoid adding the lines back by hand.
If your website still won't load after these steps, restore your .htaccess-backup file and lodge a support ticket so we can take a look.
Need a hand?
These changes are made to your website's own files, so they sit outside our included hosting support. If you'd prefer us to do this for you, we can quote it as paid support work. See our Help Desk Additional Fees page, then lodge a ticket and we'll confirm the work with you before we start.