Title: wp_comment_trashnotice
Published: April 25, 2014
Last modified: May 20, 2026

---

# wp_comment_trashnotice()

## In this article

 * [Source](https://developer.wordpress.org/reference/functions/wp_comment_trashnotice/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wp_comment_trashnotice/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wp_comment_trashnotice/?output_format=md#changelog)

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

Outputs ‘undo move to Trash’ text for comments.

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

    ```php
    function wp_comment_trashnotice() {
    	?>
    <div class="hidden" id="trash-undo-holder">
    	<div class="trash-undo-inside">
    		<?php
    		/* translators: %s: Comment author, filled by Ajax. */
    		printf( __( 'Comment by %s moved to the Trash.' ), '<strong></strong>' );
    		?>
    		<span class="undo untrash"><a href="#"><?php _e( 'Undo' ); ?></a></span>
    	</div>
    </div>
    <div class="hidden" id="spam-undo-holder">
    	<div class="spam-undo-inside">
    		<?php
    		/* translators: %s: Comment author, filled by Ajax. */
    		printf( __( 'Comment by %s marked as spam.' ), '<strong></strong>' );
    		?>
    		<span class="undo unspam"><a href="#"><?php _e( 'Undo' ); ?></a></span>
    	</div>
    </div>
    	<?php
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-admin/includes/template.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-admin/includes/template.php#L555)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-admin/includes/template.php#L555-L576)

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

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

Retrieves the translation of $text.

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

Displays translated text.

  |

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

Show Comments section.

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

Displays comments for post.

  |

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

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

## User Contributed Notes

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