- How to avoid the 403 Forbidden error in a WP Plugin with Ajax and PHP
- How do I fix PHP Error 403 Forbidden?
- What is Ajax error WordPress?
- Where is admin Ajax PHP in WordPress?
- Why 403 forbidden access is denied?
- How do I fix 403 Forbidden in cPanel?
- How do I fix 403 forbidden on Chrome?
- What does 403 Forbidden mean on a website?
- What is the difference between 401 and 403 error?
- How can I tell if WordPress Ajax is working?
- How do I use Ajax in WordPress?
- How do I get Ajax URL in WordPress?
- Wp-admin/admin-AJAX 403 forbidden
- Answer by Laylah Blackburn
- Answer by Will McPherson
- Answer by Jeremiah Meyers
- 403 Forbidden – You don’t have permission to access /wp-admin/admin-ajax.php on this server
- 403 Forbidden – You don’t have permission to access /wp-admin/admin-ajax.php on this server
- WordPress admin ajax 403 Forbidden issue fix
- Next step was to find what caused it
- What was the Work-around?
- Also Read
How to avoid the 403 Forbidden error in a WP Plugin with Ajax and PHP
First thing you need to do is to temporarily deactivate all WordPress plugins. This includes any security plugins that you may have installed on your site. If this resolves your problem, then this means one of the plugins on your website was causing this error.
How do I fix PHP Error 403 Forbidden?
- Check or reset/rename your . htaccess file.
- Reset file and folder permissions.
- Disable WordPress plugins.
What is Ajax error WordPress?
AJAX or Asynchronous Javascript and XML, is a group of techniques used in web development which allows a web page to communicate with a server without reloading the page. Using AJAX, applications on the web can exchange data with the server without interfering with the existing web page.
Where is admin Ajax PHP in WordPress?
By default, WordPress directs all Ajax calls through the admin-ajax. php file located in the site’s /wp-admin directory. Numerous simultaneous Ajax requests can lead to high admin-ajax.
Why 403 forbidden access is denied?
The 403 Forbidden Error happens when the web page (or other resource) that you’re trying to open in your web browser is a resource that you’re not allowed to access. . The second reason is that the owners of the web server have improperly set up permissions and you’re getting denied access when you really shouldn’t be.
How do I fix 403 Forbidden in cPanel?
- Refresh the page. .
- Clear your cache. .
- Try a different browser. .
- Restore your backup. .
- Contact web host. .
- Using cPanel to Troubleshoot 403 Forbidden Request Error.
How do I fix 403 forbidden on Chrome?
- What is 403 Forbidden HTTP Error.
- How to Fix 403 Forbidden Error on Google Chrome. Check URL at Chrome Address bar. Refresh the page or try again later. Clear Cookies and Cache File in Google Chrome. .
- Conclusion.
What does 403 Forbidden mean on a website?
The 403 Forbidden error is an HTTP status code which means that accessing the page or resource you were trying to reach is absolutely forbidden for some reason.
What is the difference between 401 and 403 error?
In summary, a 401 Unauthorized response should be used for missing or bad authentication, and a 403 Forbidden response should be used afterwards, when the user is authenticated but isn’t authorized to perform the requested operation on the given resource.
How can I tell if WordPress Ajax is working?
To see if the current request is an AJAX request sent from a js library ( like jQuery ), you could try something like this: if( ! empty( $_SERVER[ ‘HTTP_X_REQUESTED_WITH’ ] ) && strtolower( $_SERVER[ ‘HTTP_X_REQUESTED_WITH’ ]) == ‘xmlhttprequest’ ) //This is an ajax request.
How do I use Ajax in WordPress?
- Step 1: Create a template file and put below code into your file. .
- Step 2: Localize your script into functions.php.
- Step 3: Add function that load posts into functions. .
- Step 4: Place your AJAX JS into ajax.
How do I get Ajax URL in WordPress?
- rml-script , the registration handler of the read-me-later. .
- A string which will act like a JavaScript object.
Custom
How do I add custom fields to custom taxonomies?How do I get ACF taxonomy field?How do I add a custom field to custom taxonomy in WordPress?What are t.
Theme
How do I manually update my theme?How do I update a custom WordPress theme?How do I update ThemeForest theme?How do I update a custom plugin in WordPr.
WordPress
How do I move my WordPress site to staging to production?How do I move my website from staging to production?How do I manually move a WordPress site?H.
Answers to the most popular questions about the WordPress content management system. Lots of helpful guides and tips
Wp-admin/admin-AJAX 403 forbidden
What I could suggest is to purge the cache and check for the permissions applied to cached files as well. Note that disabling the W3 total cache plugin does not delete the cached files., Your question has been posted! Share it with others to increase its visibility and to get it answered quickly. ,As the cloud firewall filters based on source IP addresses: Would it be possible for an attacker to create packets that have a spoofed source IP address and thus break through the firewall? I mean, assuming the attacker knew any whitelisted source. file permission changed
In this case maybe you have some special rules in your .htaccess file or your Apache virtual host, I would suggest trying with the default WordPress .htaccess rules and see how it goes:
# BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond % !-f RewriteCond % !-d RewriteRule . /index.php [L] # END WordPress
Another thing that might be causing the problem is an Apache module like mod-evasive for example. Could you run the following and check for any special modules like mod-security and mod-evasive :
Also make sure to check your Apache error log for more information:
tail -100 /var/log/apache2/error.log
Answer by Laylah Blackburn
inside /wordpress my entire wordpress website exists as:,-I even changed the folder permission of /wp-admin to 755 and admin-ajax.php to 777 but still getting the same error,When I try to make a backup of my wordpress website through plugin I recieve the following error:,»403 Forbidden — You don’t have permission to access /wp-admin/admin-ajax.php on this server.»
# Begin WordPress RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond % !-f RewriteCond % !-d RewriteRule . /index.php [L] # END WordPress
inside /wordpress my entire wordpress website exists as:
-/wordpress -/wp-admin -/wp-content -/.htaccess
-Made modification in .htaccess file as follows:
# BEGIN WordPress Order Deny,Allow Deny from all Allow from all RewriteEngine On RewriteBase / RewriteRule ^index\.php$ - [L] RewriteCond % !-f RewriteCond % !-d RewriteRule . /index.php [L] # END WordPress
Answer by Will McPherson
The topic ‘admin-ajax.php 403 after installing the plugin’ is closed to new replies.,“request forbidden” error prevented the request from completing as expected. The server returned a 403 status code, indicating that the server configuration is prohibiting this request. This could be due to a plugin/theme conflict or a server configuration issue. Please try refreshing the page and trying again. If the request continues to fail, you may have to alter plugin settings or server configuration that could account for this AJAX request being blocked.”,I tried to deactivate the plugin but still have the same issue.,Thank you for your reply, The issue is that when I try to change anything from the setting of the plugins I got error too, so I cannot change anything there.
You can temporarily disable all iTSec plugin modules by (properly) adding the line below to the wp-config.php file:
define('ITSEC_DISABLE_MODULES', true);
Answer by Jeremiah Meyers
I think it has now caused a new error after that change (attached) my images arent loading on most of my subsites! I’ve reenabled 1 and 2 with no luck.,@ Living Miracles – I don’t see anything in BPS Pro 12.8 that was updated/changed/etc. that would start causing this problem. So that is probably just coincidental and something else changed somewhere else. In any case, send me a WordPress Administrator login to this site so I can figure out what is causing the problem.,/files/folders/ is in my root wordpress folder – I am running a multisite installation of wordpress. I’ll check the other plugs or themes,@ Living Miracles – Go to your BPS Security Log page and post any Security Log entries for this 403 error so I can see what is being blocked.
# admin-ajax.php & post.php skip/bypass rule RewriteCond % (admin-ajax\.php) [NC] RewriteRule . - [S=2]
403 Forbidden – You don’t have permission to access /wp-admin/admin-ajax.php on this server
403 Forbidden – You don’t have permission to access /wp-admin/admin-ajax.php on this server
When I try to make a backup of my wordpress website through plugin I recieve the following error:
“403 Forbidden – You don’t have permission to access /wp-admin/admin-ajax.php on this server.”
This error also appears sometimes during installation of plugins.
# Begin WordPress RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond % !-f RewriteCond % !-d RewriteRule . /index.php [L] # END WordPress
inside /wordpress my entire wordpress website exists as:
-/wordpress -/wp-admin -/wp-content -/.htaccess
Things I’ve tried:
-Used different plugins for backup (1 Updraft, 2 Duplicator) both show the same error.
-Change file permissions from ftp client.
Set 755 permission to wp-admin, wp-includes, wp-content directories
Set 644 to all files inside the directories and 755 to all the sub-folders.
-I even changed the folder permission of /wp-admin to 755 and admin-ajax.php to 777 but still getting the same error
-Made modification in .htaccess file as follows:
# BEGIN WordPress Order Deny,Allow Deny from all Allow from all RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond % !-f RewriteCond % !-d RewriteRule . /index.php [L] # END WordPress
-Disabled all plugins and enabled only the backup creating plugins, same error.
-Made a temporary 301 redirect in .htaccess file to be sure I was working on the right .htaccess file
-Disabled “Wordfence security” plugin
WordPress admin ajax 403 Forbidden issue fix
As a new update when you try to do this action it gives you an option to whitelist the action in question. Something like this.
So it solves this issue for the current user.
Old (outdated ?) story
I am using popular Newspaper theme on few of my websites. While editing theme settings from admin end it suddenly stopped saving theme settings. I tried different thing including inspect element and hence found this in the console. (see admin ajax 403 forbidden message)
Next step was to find what caused it
After a good amount of debugging, which included disabling all WordPress plugins and enabling them one by one, I discovered it was Wordfence Security plugin which as a measure to prevent XSS attacks blocked requests sent to admin-ajax.php as they (requests) contained javascript code which I saved to save my Google Adsense code. See Live Traffic log screen from Wordfence Security as below:
What was the Work-around?
Is there a permanent or more smarter solution? I don’t know. Disable Wordfence Security. NO, not at all!
However here is what I did in order to fix it for me. Look at the image below:
So everytime you wanted to edit theme options, just add your current IP address into this fields. If you have got static IP you could add it permanently and forgot it until your IP is changed. However if you have got dynamic IP like me, add it everytime you want to edit something in your theme including adsense ad code etc. I think if you dont have any javascript code block in your theme settings you may not be wanting to do anything silly such as this or infact you may not be looking at this post at all! 🙂
Also Read
Adding custom CSS in WordPress Admin End In my Amazing Articles in Hindi website I use Google Adsense and affiliate…
Fix to jQuery plugin does not work on ajax loaded content I had been loading table records through ajax pagination using jquery. Some of…
Security issues created to WordPress installation Received this warning in Google Chrome last night when i tried to open…
How to install a WordPress theme You can create your own working website or blog in 30 minutes using…