In WordPress, making an AJAX request is slightly different due to the way the platform handles backend requests. Let's walk through an example where we perform an AJAX request in a WordPress blog post to fetch a "Hello World" message using the WordPress AJAX API.
https://sknetking9.blogspot.com/2021/03/how-to-call-ajax-in-wordpress.html