Title: Comment gets stuck at https://randomwpsite.com/wp-comments-post.php
Last modified: April 27, 2019

---

# Comment gets stuck at https://randomwpsite.com/wp-comments-post.php

 *  Resolved [viratraaz](https://wordpress.org/support/users/viratraaz/)
 * (@viratraaz)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/)
 * After looking everything, I found that:
    there is a function called wp_new_comment(
   $commentdata, $avoid_die = false ) in site_directory/wp-includes/comment.php 
   where do_action( ‘comment_post’, $comment_ID, $commentdata[‘comment_approved’],
   $commentdata ); is not working. I want to know where this function is defined
   and where the file is included? According to my analysis ‘do_action’ function
   is being called from site_directory/wp-includes/plugin.php but I don’t see enough
   arguments in the defined function.
 * Please help.
 * {temporary solution: comment line
    do_action( ‘comment_post’, $comment_ID, $commentdata[‘
   comment_approved’], $commentdata ); which is in wp_new_comment( $commentdata,
   $avoid_die = false ) function from file site_directory/wp-includes/comment.php}

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/page/2/?output_format=md)

 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472541)
 * It is not advised to edit core WP files such as comment.php.
 * That said, this sounds like a potential plugin or theme conflict. I would suggest
   trying to debug using the Health Check plugin found here [https://wordpress.org/plugins/health-check/](https://wordpress.org/plugins/health-check/)
 * Hope this helps. Once you find a permanent solution please tag the thread as 
   resolved.
 *  Thread Starter [viratraaz](https://wordpress.org/support/users/viratraaz/)
 * (@viratraaz)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472573)
 * The problem is still there in troubleshooter running mode.
 * Actually, when any user try to comment on any post, it gets stuck at [https:///wp-comments-post.php](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/?output_format=md)
   with a _post data_. Usually, it should be redirected back to the post. But it
   doesn’t.
    As I mentioned above `do_action( ‘comment_post’, $comment_ID, $commentdata[‘
   comment_approved’], $commentdata );` in `wp_new_comment( $commentdata, $avoid_die
   = false )` function from file
    -  site_directory/wp-includes/comment.php
 *  is not working.
    -  This reply was modified 7 years, 1 month ago by [viratraaz](https://wordpress.org/support/users/viratraaz/).
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472587)
 * Your site url is not being read correctly by the code. Are you setting the site
   url and/or wp url in code or in the General Settings of wp-admin?
 *  Thread Starter [viratraaz](https://wordpress.org/support/users/viratraaz/)
 * (@viratraaz)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472633)
 *     ```
       WordPress Address (URL) : https://questuff.com
       Site Address (URL) : https://questuff.com
       ```
   
 * I have no knowledge of wordpress core files. I just proceeded from file _site\
   _directory/wp-comments-post.php_ to check what is causing problem.
    -  This reply was modified 7 years, 1 month ago by [viratraaz](https://wordpress.org/support/users/viratraaz/).
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472641)
 * Where are the site url and wp url set?
    when you look in your admin dashboard
   under Settings → General are you able to edit them there or are the fields grayed
   out?
 *  Thread Starter [viratraaz](https://wordpress.org/support/users/viratraaz/)
 * (@viratraaz)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472653)
 * I am able to edit both the field in General Settings from frontend admin panel
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472662)
 * okay. so the problem is not what I was thinking it was. I am at a loss but I 
   will draw the attention of others to this thread. someone will hopefully be able
   to provide you with a solution soon. Sorry I could not be of more help.
 *  Thread Starter [viratraaz](https://wordpress.org/support/users/viratraaz/)
 * (@viratraaz)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472666)
 * better, if i know, what is the use of `do_action( ‘comment_post’, $comment_ID,
   $commentdata[‘comment_approved’], $commentdata );` in
    `wp_new_comment( $commentdata,
   $avoid_die = false )` function from file site_directory/wp-includes/comment.php,
   i could write my own code or find any alternative solution.
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472678)
 * No, this code is not the problem. The problem is because your site url is not
   being recognized by the WP core code…..
    this became clear to me when you said
 * > Actually, when any user try to comment on any post, it gets stuck at [https:///wp-comments-post.php](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/?output_format=md)
   > with a post data.
 *  about an hour ago.
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472680)
 * Actually, where is that code? Have you tried deleting it ?
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472688)
 * Also, when you ran the Health check plugin are you sure you were running the 
   troubleshooter? It does not run it by default. You have to be sure you are running
   the site using a default WP theme (it will only change the theme for the logged
   in user) Installing and activating the plugin does not activate the troubleshooter
   you have to choose to use the troubleshooting mode which will deactivate all 
   plugins and the active theme (unless the active theme is a default theme).
 *  Thread Starter [viratraaz](https://wordpress.org/support/users/viratraaz/)
 * (@viratraaz)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472713)
 * Open `site_directory/wp-includes/comment.php`
 * Search for `wp_new_comment( $commentdata, $avoid_die = false ){....}`
 * read this function
 * see the last second line, it is
    `do_action( ‘comment_post’, $comment_ID, $commentdata[‘
   comment_approved’], $commentdata );`
 * If I remove/comment this line, everything works great.
 * **Secondly:**
    I followed your suggestion I installed plugin from [https://wordpress.org/plugins/health-check/](https://wordpress.org/plugins/health-check/)
   then I activated the plugin. after that I started troubleshooting, I got a message
   [https://ibb.co/hDJsgg9](https://ibb.co/hDJsgg9) then I test the bug again. The
   bug didn’t get resolved.
    -  This reply was modified 7 years, 1 month ago by [viratraaz](https://wordpress.org/support/users/viratraaz/).
    -  This reply was modified 7 years, 1 month ago by [viratraaz](https://wordpress.org/support/users/viratraaz/).
 *  [Davood Denavi](https://wordpress.org/support/users/binarywc/)
 * (@binarywc)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472731)
 * I think your wp install may have been compromised. because this is not normal
   for it to return that error and you are saying that the error occurs even when
   you are in debug mode using health check. So please check your site using a security
   plugin such as Sucuri or WordFence to check and be sure your site has not been
   compromised.
 *  Moderator [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * (@otto42)
 * WordPress.org Admin
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/page/2/#post-11472800)
 * [@viratraaz](https://wordpress.org/support/users/viratraaz/) There is nothing
   wrong with the do_action line. This is a standard call to invoke the [WordPress Action Hook](https://developer.wordpress.org/plugins/hooks/actions/).
 * If you have problems at this point in the code, then you have a plugin or some
   other code that is hooked to the comment_post action which is causing the problem.
   This could be an anti-spam plugin such as akismet, or anything else that modifies
   the way your site handles comments.
 * Instead of messing with the core code, try disabling your plugins to find the
   actual source of the problem. Re-enable them one at a time until the problem 
   recurs, and then you will know where the issue really is.
 *  [Shamim Hasan](https://wordpress.org/support/users/shamim51/)
 * (@shamim51)
 * [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/#post-11472828)
 * [@viratraaz](https://wordpress.org/support/users/viratraaz/)
    What you see when
   you post comment? Blank screen or any error message? Please enable debug. [https://codex.wordpress.org/Debugging_in_WordPress](https://codex.wordpress.org/Debugging_in_WordPress)
   Deactivate all plugins and change theme to one of default theme (tweenty*) Then
   post a comment and check server error log if you see any error regarding this.
 * if you do not see any error do following.
    in comment.php just before `do_action(‘
   comment_post’, $comment_ID, $commentdata[‘comment_approved’], $commentdata );`
   add following lines
 *     ```
       global $wp_filter;
        if ( defined( 'WP_DEBUG' ) && WP_DEBUG ) {
       	var_dump( $wp_filter['comment_post'] );
       	die;
       }
       ```
   
 * Then post a comment and give here what you see in browser
    -  This reply was modified 7 years, 1 month ago by [Shamim Hasan](https://wordpress.org/support/users/shamim51/).

Viewing 15 replies - 1 through 15 (of 21 total)

1 [2](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/page/2/?output_format=md)
[→](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/page/2/?output_format=md)

The topic ‘Comment gets stuck at https://randomwpsite.com/wp-comments-post.php’ 
is closed to new replies.

## Tags

 * [comment](https://wordpress.org/support/topic-tag/comment/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 21 replies
 * 4 participants
 * Last reply from: [Samuel Wood (Otto)](https://wordpress.org/support/users/otto42/)
 * Last activity: [7 years, 1 month ago](https://wordpress.org/support/topic/comment-gets-stuck-at-https-randomwpsite-com-wp-comments-post-php/page/2/#post-11475135)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
