This video tutorial walks you through the process of using ajax in the WordPress admin within your own plugins. The end result of this tutorial is not a complete plugin, but it does show the entire process, step by step, of how ajax is utilized in the WordPress dashboard.

Unlike most of my tutorials, I do not use any pre-existing plugin or code as reference during the video; it is all coded live during the video, so mistakes and small bugs are common, but they really help to illustrate issues that developers often encounter while working with ajax.

The complete source code for this tutorial is free to download below if you are logged in.

  1. Emilio

    Thanks! Saved my life. Congrats.

  2. Tommy Maersk

    This is looking really great, great video – I have however a problem, I am using it to import large xml feeds with products into wordpress.

    in the aad_process_ajax php function I have added all my code that loads the xml file with simplexml_load_file and loops trough it in a foreach loop, where I define all the data needs to be insertet in the database, and it checks if the products exists, updates them with new prices if they do etc etc.

    I can get it to run, but I think it crashes for some reasons, on small xml feeds with 100 products it runs them, but when I try with xml feeds with 14.000 products it stops inserting at some point, also on xml feeds with a 1000 products – but the loading gif just keeps running?

    You have any idea, that could help me out?
    Much appreciated:)

    • Pippin

      Are you attempting to process all of them at once or are you doing it in batches?

  3. Prabhu Bakiyaraj Chelladurai

    Hey Pippin,

    Could you please give a brief tut on doing the same with WordPress plugins using WPMVC?

    I hardly find any tip to succeed.. the WPMVC tutorial is of not much help..


  4. Amen Ra

    What if I want to use a text field to search and retrieve a specific post by title and display it on the admin page?

    • Pippin

      You can definitely do that!

      Is there a specific question about what needs to be changed to do that?

  5. Saumya Majumder

    This is bloody amazing. Thanks a ton for taking your time to make this video. Truly amazing.

  6. Saumya Majumder

    Also I have a question, I’m creating a plugin which is gonna show some stuffs in the dashboard widget using ajax, but not just once, its gonna keep updating the result after every 300ms.
    Do, you think, its good to do that they way you showed above? I’m not gonna increase the server load for my plugin.

Leave a Reply

Error: Please enter a valid email address

Error: Invalid email

Error: Please enter your first name

Error: Please enter your last name

Error: Please enter a username

Error: Please enter a password

Error: Please confirm your password

Error: Password and password confirmation do not match