This is more a PHP question than Wordpress question. You can simply use [`str_replace`][1] to change the `/` in your date to `-`. You are not changing the format, so no need for `date_format` or any other date related functions You can try something like $date = '03/09/2015'; $modified_date = str_replace( '/', '-', $date ); echo $modified_date; This will output `03-09-2015` [1]: http://php.net/str_replace