Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

96
Views
What is the best practice to send AJAX requests in Wordpress for plugin developers

We're developing an Wordpress plugin, and for that we need to send some AJAX requests in the admin side across files within our own plugin directory. Currently it is working fine if I send it directly to that specific file url, like-

$.get("https://www.example.com/wp-admin/admin.php?page=sample_projects&action=delete&id=01&noheader=true", function(status){ //Do something here });

But I'm reading everywhere in the community that to use AJAX in Wordpress I need to direct requests to admin-ajax.php. I found a good documentation here- https://codex.wordpress.org/AJAX_in_Plugins

So, my questions are-

  1. What problems may I face if I send the requests directly to this file?
  2. If I need to send it to admin-ajax.php, where do I include my javascript and PHP codes?

Thanks in advance, and sorry if this question seems repetitive to you.

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!