WordPress Admin

Change Comment Date Format Using get_comment_date Filter

The General Settings in WordPress enable you to change the format of the date which effects the comments.

There’s several formats to choose from and you can also enter in a custom date format.

date format

Another way to change the date format is to use the get_comment_date filter applied in WordPress.

Here’s one way to use the filter from your child themes functions file:

Remove Comment Date

If you want to remove the date in comments, you can remove it using the Settings > General > Date Format > Custom.

custom date format

You can also use PHP code like this in your functions file to return an empty string:


Both custom functions use the get_comment_date filter with the 1st parameter $d

$d. Date format. If this parameter is not specified, it will default to the format configured in your Settings > General > Date Format which uses get_option(‘date_format’)

Leave a Reply

Your email address will not be published. Required fields are marked *