WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

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

Every time I do a particular Ajax request at the end of the result I get a 0. Why am I getting this and is there a way to get rid of it?

The result is good it's just followed by a zero for some reason.

share|improve this question
You will need to add some of your code to get more help – Douglas.Sesar Apr 9 '14 at 21:05
Put a die() at the end of the script – Andrew Bartel Apr 9 '14 at 21:15
I just did. I got tired to looking around. – jnbdz Apr 9 '14 at 21:33
up vote 1 down vote accepted

WordPress does that by default at the end of admin-ajax.php. It kind of assumes you'll use one of wp_send_json(), wp_send_json_success(), or wp_send_json_error() to communicate your process' state (or at least terminate the script yourself). All of those use wp_die() to terminate the script after sending the response. It's sort of a catch-all response.

share|improve this answer

Your Answer


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

Not the answer you're looking for? Browse other questions tagged or ask your own question.