This documentation is only valid for older versions of Wordfence. If you are using Wordfence 7 or later, please visit our new documentation.


From Wordfence Documentation
Revision as of 12:40, 19 April 2016 by WFMattr (Talk | contribs)

Jump to: navigation, search

What is the Wordfence Web Application Firewall?

The Wordfence Web Application Firewall is a PHP based, application level firewall that filters out malicious requests to your site. It is set up to run at the beginning of WordPress' initialization to filter any attacks before plugins or themes can run any potentially vulnerable code.

What it Protects Against

The Wordfence Web Application Firewall protects against a number of common web-based attacks:

  • SQL Injection: Unsanitized SQL code that can compromise a database system.
  • Cross Site Scripting (XSS): Unsanitized HTML or JavaScript code used to hijack a user or administrator's browser session and perform actions as the user.
  • Malicious File Upload: Unsanitized files containing malicious code that can be uploaded to and executed by the web server.
  • Directory Traversal: Unsanitized path names that can be used to trick the web server into serving files containing credentials or other potentially sensitive information.
  • Local File Inclusion: Unsanitized path/file names that can be used to execute potentially malicious code available to the web server's file system.
  • External Entity Expansion (XXE): A "feature" of XML that can be used to trick the web server into serving files containing credentials or other potentially sensitive information.

Firewall Setup

The Firewall needs a short setup process in order to prevent certain types of attacks. For help with setup, see the Web Application Firewall Setup page.

How is Learning Mode used?

Details about using Learning Mode are available by clicking here.


The Wordfence Web Application Firewall has a number of rules that match known attacks, i.e. attacks commonly seen and exploited in the wild. The patterns for these attacks are specific and require minimal processing in determining if the request matches. The WAF also uses a number of generic rules that use pattern matching to determine if the request looks malicious. These are designed to prevent 0-days for known types of attacks from being exploited.

Updating Rules

Wordfence will automatically update the Firewall rules from our servers in our network operations center without having to update Wordfence. As new threats emerge, the rules used by the Firewall to protect you are updated in real-time for Premium members. Premium users receive an additional layer of protection: when new rules are added, our servers will "ping" your site to prompt Wordfence to pull down the latest rules, so you are automatically protected from attackers as new threats emerge. Free users receive the community version of the rules which are updated 30 days later.

Protection Level

The protection level shows whether the default "Basic WordPress Protection" is enabled, which can protect against many attacks, or if "Extended Protection" is enabled after following the optimization steps. Extended Protection allows the firewall to run before WordPress even starts, protecting against additional attacks. Both protection levels are available in the free and premium version. Click here for more details on Protection Levels

Firewall Status

  • Enabled and Protecting: In this mode, the Wordfence Web Application Firewall is actively blocking requests matching known attack patterns, and is actively protecting your site from attackers.
  • Learning Mode: In this mode, the Wordfence Web Application Firewall is whitelisting any requests that would normally be blocked by the firewall. Some requests contain data that may match patterns the firewall uses to detect attacks (such as an article about SQL injection that contains SQL code). While in Learning Mode, these requests will be whitelisted, excluding them from tripping the same rules once the firewall is enabled. Use this mode to prevent false positives on your site.
  • Disabled: In this mode, the Wordfence Web Application Firewall is functionally turned off and does not run any of its rules or analyze the request in any way.

Whitelisted URLs

The WAF uses pattern matching to identify malicious requests, and sometimes the content in the request may mistakenly match one of the rules and trigger the WAF to block the request. This is considered a false positive. Wordfence provides a way to exclude this particular URL and parameter from the WAF rules, so they may be whitelisted. They are typically added while the firewall is in Learning Mode, or by an admin in the Web App Firewall admin menu, or in the blocked response page.

Frequently Asked Questions

See the Web Application Firewall FAQ.