Title: wp_get_comment_status
Published: April 25, 2014
Last modified: February 24, 2026

---

# wp_get_comment_status( int|WP_Comment $comment_id ): string|false

## In this article

 * [Parameters](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#parameters)
 * [Return](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#return)
 * [Source](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#changelog)
 * [User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#user-contributed-notes)

[ Back to top](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#wp--skip-link--target)

Retrieves the status of a comment by comment ID.

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#parameters)󠁿

 `$comment_id`int|[WP_Comment](https://developer.wordpress.org/reference/classes/wp_comment/)
required

Comment ID or [WP_Comment](https://developer.wordpress.org/reference/classes/wp_comment/)
object

## 󠀁[Return](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#return)󠁿

 string|false Status might be `'trash'`, `'approved'`, `'unapproved'`, `'spam'`.
False on failure.

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#source)󠁿

    ```php
    function wp_get_comment_status( $comment_id ) {
    	$comment = get_comment( $comment_id );
    	if ( ! $comment ) {
    		return false;
    	}

    	$approved = $comment->comment_approved;

    	if ( null === $approved ) {
    		return false;
    	} elseif ( '1' === $approved ) {
    		return 'approved';
    	} elseif ( '0' === $approved ) {
    		return 'unapproved';
    	} elseif ( 'spam' === $approved ) {
    		return 'spam';
    	} elseif ( 'trash' === $approved ) {
    		return 'trash';
    	} else {
    		return false;
    	}
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/comment.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/comment.php#L1827)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/comment.php#L1827-L1848)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#related)󠁿

| Uses | Description | 
| [get_comment()](https://developer.wordpress.org/reference/functions/get_comment/)`wp-includes/comment.php` |

Retrieves comment data given a comment ID or comment object.

  |

| Used by | Description | 
| [WP_REST_Comments_Controller::handle_status_param()](https://developer.wordpress.org/reference/classes/wp_rest_comments_controller/handle_status_param/)`wp-includes/rest-api/endpoints/class-wp-rest-comments-controller.php` |

Sets the comment_status of a given comment object when creating or updating a comment.

  | 
| [WP_Comments_List_Table::handle_row_actions()](https://developer.wordpress.org/reference/classes/wp_comments_list_table/handle_row_actions/)`wp-admin/includes/class-wp-comments-list-table.php` |

Generates and displays row actions links.

  | 
| [_wp_dashboard_recent_comments_row()](https://developer.wordpress.org/reference/functions/_wp_dashboard_recent_comments_row/)`wp-admin/includes/dashboard.php` |

Outputs a row for the Recent Comments widget.

  | 
| [wp_ajax_delete_comment()](https://developer.wordpress.org/reference/functions/wp_ajax_delete_comment/)`wp-admin/includes/ajax-actions.php` |

Handles deleting a comment via AJAX.

  | 
| [wp_ajax_dim_comment()](https://developer.wordpress.org/reference/functions/wp_ajax_dim_comment/)`wp-admin/includes/ajax-actions.php` |

Handles dimming a comment via AJAX.

  | 
| [WP_Comments_List_Table::column_date()](https://developer.wordpress.org/reference/classes/wp_comments_list_table/column_date/)`wp-admin/includes/class-wp-comments-list-table.php` |  | 
| [WP_Comments_List_Table::single_row()](https://developer.wordpress.org/reference/classes/wp_comments_list_table/single_row/)`wp-admin/includes/class-wp-comments-list-table.php` |  | 
| [wp_new_comment()](https://developer.wordpress.org/reference/functions/wp_new_comment/)`wp-includes/comment.php` |

Adds a new comment to the database.

  | 
| [wp_delete_comment()](https://developer.wordpress.org/reference/functions/wp_delete_comment/)`wp-includes/comment.php` |

Trashes or deletes a comment.

  |

[Show 4 more](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#changelog)󠁿

| Version | Description | 
| [1.0.0](https://developer.wordpress.org/reference/since/1.0.0/) | Introduced. |

## 󠀁[User Contributed Notes](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#user-contributed-notes)󠁿

 1.  [Skip to note 2 content](https://developer.wordpress.org/reference/functions/wp_get_comment_status/?output_format=md#comment-content-1496)
 2.   [Codex](https://profiles.wordpress.org/codex/)  [  10 years ago  ](https://developer.wordpress.org/reference/functions/wp_get_comment_status/#comment-1496)
 3. [You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_comment_status%2F%23comment-1496)
    Vote results for this note: 0[You must log in to vote on the helpfulness of this note](https://login.wordpress.org?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_comment_status%2F%23comment-1496)
 4. **Check whether comment is approved**
 5.     ```php
        $status = wp_get_comment_status( $comment_id );
        if ( 'approved' === $status ) {
          // Show the comment.
        }
        ```
    
 6.  [Log in to add feedback](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_comment_status%2F%3Freplytocom%3D1496%23feedback-editor-1496)

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwp_get_comment_status%2F)
before being able to contribute a note or feedback.