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

---

# apply_filters( ‘widget_comments_args’, array $comment_args, array $instance )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/widget_comments_args/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/hooks/widget_comments_args/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/hooks/widget_comments_args/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/widget_comments_args/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/widget_comments_args/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/widget_comments_args/?output_format=md#changelog)

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

Filters the arguments for the Recent Comments widget.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/widget_comments_args/?output_format=md#description)󠁿

### 󠀁[See also](https://developer.wordpress.org/reference/hooks/widget_comments_args/?output_format=md#see-also)󠁿

 * [WP_Comment_Query::query()](https://developer.wordpress.org/reference/classes/WP_Comment_Query/query/):
   for information on accepted arguments.

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

 `$comment_args`array

An array of arguments used to retrieve the recent comments.

`$instance`array

Array of settings for the current widget.

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

    ```php
    apply_filters(
    	'widget_comments_args',
    	array(
    		'number'      => $number,
    		'status'      => 'approve',
    		'post_status' => 'publish',
    	),
    	$instance
    )
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/widgets/class-wp-widget-recent-comments.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/6.9.4/src/wp-includes/widgets/class-wp-widget-recent-comments.php#L109)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/6.9.4/src/wp-includes/widgets/class-wp-widget-recent-comments.php#L109-L117)

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

| Used by | Description | 
| [WP_Widget_Recent_Comments::widget()](https://developer.wordpress.org/reference/classes/wp_widget_recent_comments/widget/)`wp-includes/widgets/class-wp-widget-recent-comments.php` |

Outputs the content for the current Recent Comments widget instance.

  |

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

| Version | Description | 
| [4.9.0](https://developer.wordpress.org/reference/since/4.9.0/) | Added the `$instance` parameter. | 
| [3.4.0](https://developer.wordpress.org/reference/since/3.4.0/) | Introduced. |

## User Contributed Notes

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