# Hide Pingbacks From the Recent Comments Widget

> Leaves pingbacks and trackbacks out of the Recent Comments widget and the Latest Comments block, so they show only real conversations.

- Type: PHP
- Runs: Run everywhere
- Category: [Widgets](https://wpide.com/library/category/widgets/)
- Tags: widgets, comments, pingbacks
- Author: WPIDE Team
- Installs: 0
- Updated: 2026-10-28
- Page: https://wpide.com/library/recent-comments-widget-no-pingbacks/

## Code

```php
add_filter( 'widget_comments_args', function ( $args ) {
    // Only real comments: no pingbacks, trackbacks or other notes such as order notes.
    $args['type'] = 'comment';

    return $args;
} );
```

## Notes

Also filters out other special comment types, such as WooCommerce order notes.

## How to use it

Install the free WPIDE plugin (https://wordpress.org/plugins/wpide/), find "Hide Pingbacks From the Recent Comments Widget" in its snippet library and add it in one click; or create a new PHP snippet in WPIDE (or any code snippets plugin) and paste the code above. More snippets: https://wpide.com/library/
