WordPress Site Hangs or Times Out Over HTTPS (Wordfence Firewall in .htaccess)


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

  1. Log in to cPanel and open File Manager.
  2. Click Settings (top right), tick Show Hidden Files (dotfiles) and click Save. If you can't see your .htaccess file, see How to Find the Missing htaccess File?
  3. Open your website's folder (usually public_html), right-click .htaccess and 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

  1. Disable the Wordfence lines. Edit .htaccess and find the # Wordfence WAF section. Comment out or remove the two lines that start with php_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.
  2. 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.php file in your website's folder hasn't been changed unexpectedly.
  3. Clear Wordfence's firewall data. In File Manager, open the wp-content/wflogs/ folder and delete the .php files inside it. Wordfence rebuilds these files automatically.
  4. 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.


Was this answer helpful?

Still need help?

Our friendly support team are ready to offer assistance with any issues you may be encountering.
Click the button below to open a ticket:
Open Ticket

 WordPress Hosting

Fast hosting for WordPress
Experience the best in Australian WordPress hosting with lightning fast servers, built-in caching, and performance tools.

 Build Your Website

Sitejet Hosting
Build your site fast with a drag and drop editor with no coding required. 140+ quality, templates to get you started.

 Register Domains

It all starts with your domain name
Find the perfect domain and register now with our competitive pricing on all extensions.

 Web Hosting

Fast, local, secure hosting
Full featured hosting on cPanel with multiple server locations around the country.
« Back