When working with Ajax in WordPress, the general setup is pretty straightforward:
- Register the `ajaxurl`, if needed
- Define the hooks (or the callbacks) on the server-side
- Register and Enqueue the JavaScript files
- Have your JavaScript file(s) call to the defined server-side hooks
- Update the front-end as necessary
And the front-end may refer to the Dashboard, the public-facing part of the blog, or the both. It depends on the nature of what you’re working on.
If you’ve worked with Ajax in WordPress in-depth for any amount of time, then you’re likely familiar with the above process. You’re also familiar with the challenges of maintenance depending on how the code was setup.
If you’re just getting started, then perhaps this post will help shortcut some of the learning the rest of us have had to do.
I don’t think the Ajax APIs are that bad. I know – this is subjective. But from the a maintenance standpoint I believe that there’s at least one thing we can do to make development and maintenance easier.



