Skip to content

Instantly share code, notes, and snippets.

@amenk
Created October 20, 2025 10:37
Show Gist options
  • Select an option

  • Save amenk/5866f96f71274e9d3a8925a243b9cec0 to your computer and use it in GitHub Desktop.

Select an option

Save amenk/5866f96f71274e9d3a8925a243b9cec0 to your computer and use it in GitHub Desktop.
ModSecurity Exceptions for WordPress
# /etc/modsecurity/local.conf
<LocationMatch "/">
SecRuleRemoveById 933210
</LocationMatch>
<LocationMatch "/wp-admin">
SecRuleRemoveById 200004
</LocationMatch>
<LocationMatch "/wp-admin/admin.php">
SecRuleRemoveById 980140 959100 941160 941100 980130 941110 949110
</LocationMatch>
<LocationMatch "/wp-admin/page.php">
SecRuleRemoveById 300013 300014 300015 300016 300017
</LocationMatch>
<LocationMatch "/wp-json/wp/v2/">
SecRuleRemoveById 941180 980130 933210 949110
</LocationMatch>
<LocationMatch "/wp-admin/post.php">
SecRuleRemoveById 300013 300014 300015 300016 300017 951100 951200
</LocationMatch>
<LocationMatch "/wp-admin/admin-ajax.php">
SecRuleRemoveById 300013 300014 300015 300016 300017
</LocationMatch>
<LocationMatch "/wp-admin/options-general.php">
SecRuleRemoveById 941140 949110
</LocationMatch>
<LocationMatch "/wp-admin/network">
SecRuleRemoveById 300013 300014 300015 300016 300017 921130 941110 941160 941180 949110 980130 941100 949110
</LocationMatch>
@amenk
Copy link
Author

amenk commented Oct 20, 2025

AS IS - NO WARRANTY - Comments welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment