I can’t get my WP Snippets PHP to save

I

Culprit: WAF – Web Application Firewall

Sometimes, when I go to save a Snippets plugin code snippet I get an error that reads, “Could not update snippet. Request failed with status code 403.”

Add new snippet request failed 403

For me, the issue is that WAF blocked my snippet code from saving. Here’s how I get my Code Snippet to save.

Disable WAF or Disable Rule by ID

Today, I was working on a site hosted on WPMU Dev hosting. Here’s how I can disable the rule or temporarily disable WAF. I go to Hosting > Logs > WAF Log. I look for the Rule ID (underlined below).

WAF logs

Disable a Rule

Go to Hub > Hosting > Tools > Web Application Firewall > Edit. Scroll down to the area that reads Disabled Rule IDs. Enter your WAF rule ID, one per line and then Save.

Disable rule ids

You can also temporarily disable the WAF.

Alternatively, you can toggle on or off the Enable WAF option in Web Application Firewall.

Enable or Disable WAF

Once this is completed, resave your Snippet. Likely, you’ll see that the Snippet was created and activated. Success!

Snippet created and activated

Happy WordPressing!

About the author

Kelly Barkhurst

Designer to Fullstack is my place to geek out and share tech solutions from my day-to-day as a graphic designer, programmer, and business owner (portfolio). I also write on Arts and Bricks, a parenting blog and decal shop that embraces my family’s love of Art and LEGO bricks!

Add comment

By Kelly Barkhurst

Recent Posts

Archives

Categories