Akismet marks most of the comments coming from a custom form as spam


On our website we have an HTML endpoint we load via ajax in a fancybox which loads the comments for a given post id.

GET /custom-functions/comments-with-form?post_id=123

When loading it on the page, it looks like this:

| <Comment-textarea>        |
+---------------------[Comment as Alice]


What is loaded on the client is exaclty the same template that is loaded in the post pages.

However, when posting a comment from the page (a different page than the post page) where we load the HTML in the fancybox, the comment is recorded but automatically marked as spam by Akismet.

I have checked the request body and it has all the fields the same (including the akismet nonce). I am wondering if Akismet has a validation against the Referrer header because that is the other different data compared to the post comments request.

In any case, I cannot seem to figure out why Akismet marks the comments from the custom endpoint as spam, while the comments coming from the original post page work fine.

I have tested disabling JavaScript, but that did not make any change.

How can I fix this? I want the users to be able to use the comment form from another page too.

, , Ionica Bizau 4 years 2020-06-09T12:10:33-05:00 0 Answers 80 views 0

Leave an answer