• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

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:

Parameter

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’)

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems