'WordPress Website shows 403 error when accessing wp-admin/ajax.php page from front end

I am running a WordPress on an Azure Web app connecting to a MySQL server on a different Windows server. When loading the mentioned page in Chrome, it shows 2 popups 403 & Forbidden. Checking the console throws this error - ecbcc.js:2 POST /wp-admin/admin-ajax.php 403 (Forbidden)

This works fine on FireFox & IE but not on Chrome. Any ideas why?



Solution 1:[1]

This is because of your cache. Minified version of JS is causing the issue in chrome browser. Check or purge the cache and check for the permissions applied to cached files as well.

Solution 2:[2]

I faced the same issue but it took a long time for me to fix it. Because my solution was not caused by common things like cache, .htaccess, files permissions, etc. I apply all the possible solutions as described here. When nothing worked for me, then I talked with my hosting provider and the issue was on their side. Actually, the server has black-listed my IP.

Below is the reply from the support of my hosting provider:

After checking it, it looks like the issue is caused by trigger ModSecurity rules.

ModSecurity is an Apache module that works as a web application firewall. It blocks known exploits and provides protection from a range of attacks against web applications. However, sometimes, mod_security may incorrectly determine that a certain request is malicious, while it is actually legitimate. In such a situation, we can whitelist the triggered mod_security rule on the server, so that you can bypass the block.

In order to properly investigate, we need you to share your IP address with us. You can copy it from here: https://ip.web-hosting.com/

Looking forward to your response.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Ahmed Ginani
Solution 2 Martijn Pieters