"Sorry, you have been blocked" While Adding Code to WordPress Header Plugin

Hi,

I use a WordPress plugin called Head, Footer and Post Injections. I added the AMP auto ads script in the head section form of the plugin. I then clicked on save and Cloudflare blocked it:

I am uncertain of what I can do to fix this. I am sure there is an exception I can add via WAF but I’m not exactly sure what.

Thanks!

Hi,

First you go to your CF Dashboard > Security > Events and filter results based on the RayID mentioned in the block page. When you find it, the event details should contain the Rule ID for the rule that blocked the request. You can then use that string to search for the rule when creating an exception.

2 Likes

Thanks!

You can then use that string to search for the rule when creating an exception.

So I have that rule ID but I am not exactly sure what to do with it when clicking on “Add Exception” via CF Dashboard > Security > WAF > Managed Rules. I do not see an option to add that, I apologize.

No need to apologise, we’re all learners here. In a WAF Events screen, you see, among other things:


Hover you mouse over the last line of the value that says “Rule”, and copy it. You’ll paste it later when adding the exception.

When you’re adding an exception:


Then on the next screen:

Once you click on the appropriate Ruleset, you’ll see a screen that lets you search for a Rule. After you paste the Rule ID you copied before, the rule will appear, with a checkbox next to it. Select it, then click Next.

You’ll see another screen to review your WAF Exception. If it’s all good, click on Deploy.

I hope that works for you.

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.