admin-ajax.php loads only when admin runs ajax

I am running this ajax from script tags:

var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php' ) ) ?>';
$.ajax({
    type: "POST",
    url: ajaxurl,
    data: booking_data,...

When I am logged in(as admin) this works perfectly, but when I run this as a guest got 404 on admin-ajax.php. Checked solutions with ‘wp_ajax_nopriv_(action)’ but there is no action to add with this.

Plugins: woocommerce, visual composer…

Read more here: admin-ajax.php loads only when admin runs ajax

Leave a Reply

Your email address will not be published. Required fields are marked *