WordPress: My Ajax call always returns 0 in Internet Explorer – what’s going on?

This post is for everyone who have exhausted all Ajax options on stackoverflow and still return a response body of 0.

Go to your functions.php and check your add_action which should look similar to the below:

add_action('wp_ajax_myfunction', 'myfunction');

This is perfectly fine and works … if you’re logged in to WordPress already.

You need to add a second add_action line

add_action('wp_ajax_nopriv_myfunction', 'myfunction');

This will now work for users who were not logged in to WordPress.

If that fixed your ajax issue

You simply forgot to add an action for users without privileges. For any form that was being submitted that’s going to hurt as that data probably wasn’t captured.

Side note:

The above has absolutely nothing to do with Internet Explorer apart from the fact that you most likely aren’t logged in to the CMS on IE.

More refs:

Why do my imported WordPress posts have different IDs

Q: Why do some of my imported WordPress posts from my old site have different IDs on my new site?

A: You added ACF (advanced custom fields) which also use page IDs. On your live site you continued to make posts while working on your development. When you imported your posts the post IDs increment as they were already taken (by ACF components). As a result you will need to look out for old post URLs that now map to attachments or incorrect posts – these will look like 301 redirects and not 404’s.

This should only affect you if your permalink structure finishes with %post_id% instead of %postname% as it’s the ID which has incremented.