I am running this ajax from script tags:

var ajaxurl = '<?php echo esc_js( admin_url( 'admin-ajax.php' ) ) ?>';
    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


If you know the solution of this issue, please leave us a reply in Comment section, to update the question.

Wordpress related questions and answers: