This filter returns the HTML that displays your post date along with your blog posts.

You can use this filter to completely overwrite the HTML given, or even add to it.

For example, if you wanted to add a clock icon before your date, you could do this:

add_filter( 'generate_post_date_output','tu_add_to_post_date' );
function tu_add_to_post_date( $output ) {
    return '<i class="fa fa-clock-o" aria-hidden="true"></i> ' . $output;

Another example is if you want to remove the date on a specific post type, but keep it elsewhere:

add_filter( 'generate_post_date_output','tu_post_type_remove_date' );
function tu_post_type_remove_date( $output ) {
    // If we're on our "my-post-type" post type, remove the date.
    if ( is_post_type_archive( 'my-post-type' ) || 'my-post-type' == get_post_type() ) {
        return '';

    // Otherwise, display it.
    return $output;

If you want to remove the link from dates:

add_filter( 'generate_post_date_output','tu_remove_date_link', 10, 2 );
function tu_remove_date_link( $output, $time_string ) {
	printf( '<span class="posted-on">%s</span>',

As you can see, this filter is very powerful and gives you full control over your post dates.