Here’s the “long story short” version of my issue:
I have this newsletter/subscription form that triggers the wp-admin/admin-ajax.php file, however the form wasn’t working when I wasn’t logged into WordPress.
Turns out, the admin-ajax.php file has a 302 going against it.
I have already seen/tested previous resolutions of this problem (namely this one and that one), however none of them were helpful.
I searched throughout my theme files for any related “wp-admin” protections, I didn’t find anything.
I modified and deactivated both WP Better Security and W3C (as well as various other plugins), nothing changed.
I changed/removed the htaccess, nothing changed.
I’m kind of getting frustrated with this issue.
At this point, I know there’s somewhere in my code something blocking access to admin-ajax.php for “outsiders,” however I can’t figure out where.
It’s either something protecting my admin folder and/or something protect admin-ajax.php.
Any ideas?
Help would be much appreciated.
Thanks in advance!
Ok, the problem here is that WordPress uses two different hooks for ajax. It uses one for admin side, and one for logged out user. My guess is that your form is not using the latter.
Have a look at the two:
From WordPress Codex:
See here: http://codex.wordpress.org/AJAX_in_Plugins