This post won’t go into detail about what nonces are and how they work/why they are important. There are some great posts out there that go into that really well. Here are a few:

But this post is for those who KNOW that they have set up check_ajax_referer correctly, understand how it works, and it still is not working correctly.

The solution may be simple:

For me, the issue was that the website was running on an SSL certificate. This meant that the admin_url was pointing to “https”, but the page I was looking at had loaded on “http”. This meant that to the nonce and check_ajax_referer, I was on 2 different websites. So it was correct in throwing a security error. Just something to keep in mind if you’re struggling with check_ajax_referer – even though it should be working.

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.