I’m sorry can’t comment here but i’ll try to help.
wp_handle_comment_submission function handing comments posting contains exact check for post_id:
$post = get_post( $comment_post_ID );
if ( empty( $post->comment_status ) ) {
...
return error_happened;
}
i.e.
(1) it passes through , or
(2) comment was added other than default way of posting comments.
For (1) – check that post with id=0 doesnt exists in db, wp_posts table. Sometimes failures in database cause presence of such records
Related Posts:
- What for is the table “wp_commentmeta” exactly?
- Resetting comment count
- Would switching to InnoDB from MyISAM improve performance of comments table?
- Why do I get accidental comments without (the required) email address?
- Can I store my custom comment_type into wp_comments table?
- Using Disqus, how to stop storing comments in wp database?
- How to Block Access to Standard Login Flow and Comment Flow
- What are the additional fields in wp_comments used for?
- Strategies for coping with hyperagressive spambots?
- migrate comments from old database to new database
- WordPress unresponsive after calling wp_update_comment()
- What is the correct/safe way to delete all comments?
- Sanitizing comments or escaping comment_text()
- Recent comments from my blogs only
- Add action on delete comments?
- wp_insert_comment and security
- How can I get a list of comments by target
- Is WordPress vulnerable to “comment posting forgery”?
- WordPress ‘comment counts’ got messed up, because of a plugin – DISQUS
- delete duplicate comments
- Admin can enter JavaScript – potential security risk?
- reCaptcha doesnt appear in comment (manual or plugin)
- WordPress scruity issue – Totally disable all comments by CSS — secure enough?
- How are readers authenticated for leaving comments?
- WordPress Commenting System User access and Security
- How do I comment out a block of tags in XML?
- R: Comment out block of code
- Why do I get comment spam even with Akismet and Captcha?
- What tools are available for managing/writing to WordPress? [closed]
- How to rearrange fields in comment_form()
- setting comments off as default for pages and custom post types?
- Is it possible to pull comments from facebook into your blog?
- Filtering the Admin Comments List to Show Only Comments from the Current User?
- Non-threaded comment replies with link to original comment
- Approve comment hook?
- Commenting in user profile page?
- How to change “You must be logged in to post a comment.”
- Disable comments on all posts/pages
- How do I delete all comments from a specific old blog post?
- Removing the “Website” Field from Comments and Replies?
- Stop WordPress redirecting comment-page-1 to the post page?
- Importing old Disqus comments into WordPress
- How to add a class to the comment submit button?
- How to wrap submit button of comment form with div
- How to enable comments for pending and draft posts?
- Using WordPress’ WYSIWYG for comments
- Enable Submit Comment Without Page Reload (Using Ajax)?
- Getting Post Comments for post ID using WP_Query() and a Custom Loop?
- Add option to disable comments on a per posts basis?
- When importing – failed to import: Invalid post type feedback
- How to change the email notification recipient (user) for new comments?
- Redirect user to a custom url after submitting the comment
- Paginate result set from $wpdb->get_results()
- Is sanitize_text_field() is enough to save to DB?
- Change Comment Author Display Name
- Custom comment type based on thread level
- How to add internal, revision comments to page updates
- How to load and show comments with AJAX instead of pagination?
- Linking to Page Showing Only Comments Without Parent Post
- Comment Reply javascript
- How do we remove the H3 tag for the reply-title I.D
- Comments not appearing at all
- comments reply script not working
- How to display comment form error messages in the same page
- 3 moderators to approve comment
- How to deal with small scale comment spam on small commercial sites? [closed]
- What should I do to make generated avatars different for anonymous comments?
- A plugin where users can comment with Facebook or Twitter or OpenID [closed]
- Check If comment author is registered
- Comments screen in backend, how to disable email address of commenter for non admins
- Add comments from the admin panel?
- How can I limit the number of comments per registered user per day?
- One comment per user per post but be able to reply to existing comments
- Writing a plugin that notify my friends of new post that mentions(@) them
- How to use a custom comments template
- Comment visibility
- What’s the easiest way to close comments on media/attachments?
- Reverse comment pagination numbers
- Get comments for more than one post
- How can I add comments to a page?
- How to remove comment spam in WordPress
- Post Comments using WP REST API v2 in WordPress
- show number of open comments on custom dashboard
- Show content only if member left a comment
- Add placeholder attribute to comment form fields
- How is comment spam received without a comments form?
- Does a reply to a wordpress comment notify the author of the comment?
- What are the current recommended best-practices for comments.php?
- human_time_diff() returns “48 years ago” for all comments
- How do I set up real anonymous posting in bbpress forums? [closed]
- Comment Count for each Comment Author
- Link name in comments to Author page? Comment Author Meta in Comments?
- What is the most secure way to store post meta data in WP?
- How do I turn off wordpress comments ability to capture a users ip address?
- Showing comments only to same custom user role
- Parent comment’s author name
- Success message in comment form
- get_comments_number of depth-1 (Level 1) (1 post)
- Show comments from multiple post IDs in comment template
- Running a function on comment status change