A couple of months ago, I started receiving this error when trying to upload media to WordPress:
“The server cannot process the image. This can happen if the server is busy or does not have enough resources to complete the task. Uploading a smaller image may help. Suggested maximum size is 2560 pixels.”
Both my WordPress settings and config files and my server settings and config files were all correctly set up, so I was stumped as to why I was receiving this error message.
It turns out the issue was Cloudflare’s Web Application Firewall rules.
In Cloudflare’s WAF settings, two “Managed rules” were enabled: Cloudflare Managed Ruleset and Cloudflare OWASP Core Ruleset. These rulesets block the execution of the admin-ajax.php file that WordPress uses to process media uploads. This file is potentially needed for many use cases and should generally not be blocked.
The solution was to add a custom managed rule that skips the execution of those rules if admin-ajax.php is being accessed.
I added a new rule called “Allow admin-ajax.php” with the following setting:
URI Full contains admin-ajax.php
Then, set that rule to “Skip all remaining rules” and place it as the first managed rule that runs.

