The wp_ajax_{action}
hook only fires for logged in users. For logged-out users the action wp_ajax_nopriv_{action}
is triggered on an ajax request – so you need to hook into that as well.
Related Posts:
- WP-API and Basic Auth returning 403 on POST but not GET
- wp-admin AJAX with Fetch API is done without user
- how to send Ajax request in wordpress backend
- SSO autologin WordPress + Ajax
- What WP-API authentication method should I use to interact with anonymous / not-logged visitors?
- Usage of wp_send_json_success and wp_redirect at the same time
- jQuery’s .on() method combined with the submit event
- Why is die() used at the end of function that handles an Ajax request?
- Making my AJAX powered WordPress Crawlable
- Using Backbone with the WordPress AJAX API
- WordPress Ajax Data Security
- Why is a 500 error generated by admin-ajax.php not going into the Apache error log?
- admin-ajax.php doesn’t work when using POST data and Axios
- Registering AJAX callback function that is part of a class without instantiating the class in function.php
- How to tie built in AJAX to an add_action?
- admin-ajax.php vs .load() in WordPress
- Refused to execute script from ‘***’ because its MIME type (‘text/html’) is not executable, and strict MIME type checking is enabled
- AJAX call using admin-ajax URL is returning 400 bad request
- Ajax response is always 0
- Ajax with OOP doesn’t work
- Error 400 bad request using admin-ajax.php
- Setting TinyMCE Content in wp_editor
- Ajax is not working for logged out users
- WP Ajax Action Not Picking Up Query String Parameter
- How to use wp_send_json_error?
- Ajax Redirect role = ‘Editor’ to their Dashboard after register
- WordPress AJAX Call Not Return Result
- Form data is empty while posting form through ajax using jquery in WordPress
- load next and previous posts by Ajax and URL update
- How do I check if AJAX nonces are implemented correctly?
- Can I fire an add_action hook inside of a function that recieves data via wp_ajax?
- WordPress Ajax Problems
- Force redirect not logged in user to (wp-login.php or wp-admin) for specific page
- How to insert a record by clicking on the link using AJAX
- How can I access the Header of and ajax response from the rest API
- Getting back to ajax search results from a page
- Updating a checkbox value to database for specific row in table
- WordPress Ajax Not Working ( Custom Admin page)
- WordPress ajax success response
- Load JavaScript from a post that’s loading into Fancybox via ajax
- Gravity form Load By Ajax Cannot Submit – Error 400
- rest_no_route custom route
- How get child posts in custom post type by ajax?
- contact form ajax empty response error message
- Cache wp-json/posts without a plugin?
- What is the best way to do MyAjax error and success handling?
- Gravity Forms closes my popup on Validation Error [closed]
- infinite-scroll for 2 fixed height containers
- Attach time/date stamp on add_post_meta
- “Loadmore” button is not working in buddypress [closed]
- Uncaught ReferenceError: the_ajax_script is not defined . How is this not defined?
- infinite scroll not working when logged out
- Right way to include blog-header.php?
- I can’t get a return value from Ajax
- WordPress AJAX return 0 – My case
- Creating an auto result search bar
- update_option is not saving an array, but saving the string ‘Array’
- Ajax call in wordpress not working for subscriber user
- Upload data from weather station to WordPress Website
- Ajax call in WordPress – unable to display the data on the page
- How to reuse get_template_part() containing a simple loop to work with AJAX correctly?
- Need help with ajax
- Using nonce when loading posts with AJAX
- How to call ajax in plugin file
- Tabbed feeds with ajax vs. without on homepage [closed]
- javascript onClick update user_meta from jquery.ajax
- How to ignore WP_ERROR caused by “get_the_excerpt” method in an AJAX call?
- WP_Query is not received in Ajax
- How do I mitigate replay attacks when talking about actions that shouldn’t happen twice?
- Updating Jquery object with newly created elements after AJAX call
- Not getting ajax success response on insert/update row to database
- Wp admin ajax load more
- Ajax call from Plugin using Class
- enqueue style using admin-ajax.php
- How to safely pass post_id and user_id via AJAX to the backend (prevent user from changing it via JS)?
- Can’t get next post info with ajax
- How to inject data content from external json into a modal, using UIkit?
- Ajax by worpdress affects called jquery inside template file
- AJAX form not working, still reloads on submit
- Call public static method from ajax ‘wpcf7_mail_sent’ hook
- Update user meta via ajax from frontend, saving issue
- How to get the admin page slug using wp_loaded hook?
- Edit user meta on front-end via AJAX
- How to paginate Ajax result
- Cannot access class properties from ajax call in wpordrpess
- why is my main.js not loading?
- Enqueue dynamically generated javascript
- First time doing Ajax with WP, how to do it?
- WordPress Get Header and Footer using in Admin Area
- Tie the sending of an ajax request to WordPress hooks
- AJAX: admin-ajax.php is adding extra content to my script’s response – how to exclude header, footer, etc.?
- ajax page template
- apply_filters, EMBEDS and AJAX not a friends? [duplicate]
- How to get data with Select AJAX PHP
- Add “load more” functionality to an AJAX response
- Bad Request 400… jQuery ajax post of json data to wordpress admin-ajax.php
- Why are the most recent posts not appearing in a fetch request, unless I’m logged in?
- Successful ajax call returns lots of whitespace and text of code with 0
- How to submit a button automatically after every scheduled hours?
- At what stage does wp_ajax hooks gets applied during WordPress request?