I need to change post publish date to modify date every where in my theme.

I know that I can use the_modified_date() function to display post modify date.

But changing in every place takes too much time.

Is there any way to change it using action hook or filter? (All theme in just one place)

1 Answer 1


I wonder if this would work for you:

is_admin() || add_filter( 'get_the_date', function( $the_time, $d, $post  ) 
     return get_the_modified_date( $d, $post );
}, 10, 3 );

where we override the output of get_the_date() with get_the_modified_date(), for the front-end.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.