Add a wp-ajax.php at the root of wordpress

  1. Tofandel

    Currently there is an admin-ajax.php that works great but has very poor performance because it sets is_admin() to return true and so some plugins or even the core start do do some heavy computation or config, although normal for the backend ajax; it would be great to have a non admin wp-ajax in WordPress 5.

    It would be located at the root of wordpress so the admin_hooks won't have to load/fire, the wp_query won't have to process and frontend plugins will be able to use this ajax instead of the old admin ajax, greatly reducing the loading time of the ajax-call and the load on the server, (+ there is already the nopriv hook so the separation will be easy to implement for plugins).

    There is currently workarounds such as just using parameters in the url (like wc-ajax for woocommerce) but those are not actually better because the wp_query still tries to do some work beforehand and some plugins do whatever they want with this and sometimes it's really really ugly...

    A core and unified way of doing that would be great for the community, better performances for users and happier developers spending less time implementing their ajax hooks.

    Posted: 2 years ago #
  2. ilovesolution


    We would really appreciate this modification. Our customers often complained about bad load times due to 404-error with admin-ajax.php file.
    We have seen this in combination with security plug-ins and certain contact forms (mostly Ninja Forms) on first pageload.

    Posted: 1 year ago #
  3. Really this can be a great modification

    Posted: 1 year ago #

RSS feed for this topic


You must log in to post.

  • Rating

    4 Votes
  • Status

    This idea is under consideration