WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top
  1. www.mysite.com/wp-admin/admin-ajax.php returns error 404 when logged out.
  2. www.mysite.com/wp-admin/admin-ajax.php loads a blank page with 0 when LOGGED IN. This is the proper behavior as per Wordpress.org AJAX
  3. There are NO rewrite rules on my .htaccess files.

    # BEGIN WordPress RewriteEngine On RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L]

    # END WordPress

  4. Also tried turning off all plugins and still can't access admin-ajax.php when logged out.

Anyone have an idea why wp-admin/admin-ajax.php returns 404 when NOT LOGGED IN? Normally when you access www.mysite.com/wp-admin/admin-ajax.php it should return a blank page with 0.

share|improve this question
are you accessing those URLs directly? they're not meant for that – moraleida Aug 5 '14 at 3:07
I'm not accessing them directly but use it for ajax request. I use it with the following hooks and call them on my javascript ajax request. add_action('wp_ajax_nopriv_my_action', 'my_action'); add_action('wp_ajax_my_action', 'my_action'); But for some reason it only works when logged in. If I'm logged out it returns error 404. @moraleida – SandoMarco Aug 5 '14 at 3:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.