把下面这段代码放到 functions.php 内即可

add_filter( 'wp_unique_post_slug', 'wmou_unique_post_slug', 10, 6 );
function wmou_unique_post_slug( $post_ID ) {
    $new_slug = md5($post_ID);
    return $new_slug;
}