Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Allow guest to update custom post met using ajax

There are two hooks for adding AJAX handlers, you’re missing the one for non-logged in visitors. You need:

add_action( 'wp_ajax_nopriv_adClickCounter', 'adClickCounter_ajax' );

… in addition to the add_action call you currently have. Note the extra nopriv_ in the tag.

Related Posts:

  1. Long Polling: Stuck in while loop
  2. How to update Comment post meta through an Ajax call
  3. Update attachment metadata fails
  4. Attach time/date stamp on add_post_meta
  5. bulk update meta value with ajax
  6. Update status, meta while inside a post using AJAX button
  7. Filter images from media library by guid meta field
  8. Want to send ajax request in wordpress to a custom file in plugin
  9. delete post meta data in array WordPress
  10. Data from ajax not updating post meta
  11. delete attachment for one post without deleting actual attachment post
  12. Access-Control-Allow-Origin error sending a jQuery Post to Google API’s
  13. WordPress AJAX with Axios
  14. Why might a plugin’s ‘do_shortcode’ not work in an AJAX request?
  15. Get Previous & Next posts by Post ID
  16. Nonces and Cache
  17. REST API endpoint for elasticpress autosuggest
  18. ajax – why multiple calls to wp_create_nonce() return same value?
  19. AJAX request on the frontend always returns 0 if user is not admin
  20. Using ajax on categories and wordpress loops
  21. Cannot load admin-ajax.php. No access-control allow origin*
  22. wp_remote_get() to get AJAX url /wp-admin/admin-ajax.php
  23. Can’t seem to get wp_localize_script to work
  24. Ajax – gettext without a plugin
  25. WordPress AJAX calls not detecting language properly?
  26. AJAX issue – Uncaught SyntaxError when processing Zip File
  27. wp_verify_nonce doesn’t return true on server when it matches the nonce
  28. update_user_meta doesn’t work with AJAX
  29. WordPress ajax get content post id
  30. Using wp_handle_upload and media_handle_sideload with ajax
  31. Load ajax if is_home()
  32. How to know what page is calling admin-ajax.php?
  33. Populate a Map at The Same Time as showing Posts via AJAX
  34. wp_localize_script not working on ajax response
  35. Get wp_title wp ajax
  36. Why Does WordPress not output admin-ajax.php path by default?
  37. Ajax custom search not functioning as expected
  38. Jetpack Infinite Scroll – Add more than 7 posts each time?
  39. SSO autologin WordPress + Ajax
  40. Speed/Performance difference between `wp_ajax` and `init` checks for AJAX/POST requests?
  41. Test WordPress api with postman
  42. Remove trailing 0 from function that is used both statically and dynamically
  43. How to process wordpress ajax call without action parameter?
  44. How to load next and previous posts by Ajax
  45. Nonce fails on ajax save
  46. WordPress P2 live problem
  47. Dynamically add more fields/remove last field in a form
  48. Ajax Request for both logged and non logged users
  49. AJAX call inside plugin class not triggering
  50. Force redirect single.php to index
  51. Any plugin or Script to integrate ajax selection module into WordPress page
  52. WordPress Heartbeat API cannot parse data
  53. Ajax function on #publish only saves as draft – how to make it publish?
  54. AJAX call broken after actualization
  55. WP_Ajax Hook doesn’t execute this PHP code
  56. How to include php-generated javascript?
  57. Serve a different theme based on window size
  58. Ajax function not returning any results
  59. post values to custom post type which has advanced custom fields
  60. wp_mail doesn’t work when logged in?
  61. How to continuously send feedback via AJAX responses to my client?
  62. get current taxonomy post with ajax
  63. WordPress Ajax Filter
  64. Need help with Access-Control-Allow-Origin
  65. Send email via ajax
  66. wp_ajax handler with multiple class instances
  67. admin-ajax.php (aborted) error when using jQuery.get
  68. Storing temporary data for a custom post type
  69. I get a 0 after the result of my ajax requests
  70. Load page HTML content through AJAX
  71. Not getting an ajax readystatechange on my page
  72. Problems implementing Load More functionality
  73. WordPress Select Option Load Custom Fields
  74. Add ajax to plugin in admin area
  75. Search live Ajax
  76. Ajax login fails: script sets cookies, but is_user_logged_in() returns false
  77. Using wp_send_json_success instead of $result[‘message’], die, etc
  78. do_action won’t work in ajax callback
  79. 400 Bad request while submitting form using AJAX
  80. AJAX POST Value not being returned – WordPress – AutoTrader API
  81. Its possible to ajax update the content of the admin custom post type list
  82. WordPress custom ajax login not working on mobile browsers
  83. Ajax call on class returns old data
  84. how to enable ajax on submitting of contact form 7?
  85. How to trigger lost password email using REST API?
  86. Display post thumbnail after clicking on post id with AJAX
  87. Using AJAX on Contact-form the WordPress way
  88. Error while submitting form using AJAX and php
  89. WordPress AJAX load post metadata in modal
  90. Know which script/page is being called by ajax call
  91. Trying to send AJAX data to WordPress hook
  92. wp_enqueue_media problem
  93. Update user meta using Ajax on front end?
  94. retrieving page content per AJAX [duplicate]
  95. Can’t access data from database using AJAX
  96. Running js in html code with same content
  97. how can i create get request unis ajax without expecting return value
  98. How to use Ajax with WordPress
  99. Using $.ajax getting 500 error
  100. admin-ajax.php 400 (Bad Request) what am I doing wrong?
Categories ajax Tags ajax, post-meta
WordPress update 4.4.1 redirect loop
What problems could happen if I replaced add_filter and add_action with the function calling

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • Get the name of the template/*html file used
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
  • How to display the description of a custom post type in the dashboard?
  • Critical error on image display
  • Copying WP data and files into new install?
  • How to determine the DirectAdmin WordPress backup date?
  • How to get list of ALL tables in the database?
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress