Auto-generate a unique random string and set it to post_name.
Use of filter hooks is at your own risk.
add_filter( 'random_post_name_post_types', 'hoge' ); function hoge(){ return ['post', 'page']; }
add_filter( 'random_post_name_digits', 'hoge' ); function hoge(){ return 20; }
add_filter( 'random_post_name_choices', 'hoge' ); function hoge(){ return '0123456789abcdefghijkmnpqrstuvwxyz_-'; }
Too few characters and too few character variations can cause unexpected problems.