Resources

Guides

Step-by-step guides to building, running and maintaining WordPress sites.

How to Make an AJAX Call in WordPress

A WordPress AJAX call sends request data from a page script to admin-ajax.php. Pass the AJAX URL, POST with jQuery.ajax() or fetch(), and handle the reply.

How to Use admin-ajax.php in WordPress

Use admin-ajax.php in WordPress: add a handler on the wp_ajax_ hook that a request's action value fires. Covers logged-out users, core actions and DOING_AJAX.

How To Use Ajax in WordPress

Use AJAX in WordPress through one admin-ajax.php exchange: enqueue the script, pass it the URL and a nonce, and send the call. Handle it in PHP and return JSON.