Why WordFence Throws a Fatal Error After Migration
When you created a staging site on another server or moved your entire website to another domain, it sometimes leads to a fatal error, and your migrated website does not work.
This can happen if the WordFence plugin is installed and its Web Application Firewall (WAF) has been activated.
The reason for this fatal error is that on activating the WordFence firewall, WordFence generates a
.user.ini file at the root of your WordPress installation and this ini file contains the absolute path to the PHP file
After cloning into a staging site or migrating your website to another host, the
.user.ini still contains a link to the absolute path of the original website’s
If the path to that file changed or the file is not available any more on the original website, WordFence will throw a fatal error and your WordPress website fails to load.
To avoid this error, newer versions of WP STAGING rename the
.user.ini.bak on all cloned websites.
How to Activate WordFence Web Application Firewall on the Staging Site
- Edit the file
user.ini.bakand change the path to
wordfence-waf.phpaccording to the absolute root path of your website.
- Rename the file