I want to have a custom permalink for each new post in WordPress like: http://mysite.com/x5Kvy6 (like bit.ly).
I tried this little script, but it adds only 5-digit numbers to the post title in the permalink.
function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_parent ) {
if($slug!=""){
$random=rand(11111,99999); //I needed 5 digit random
$slug .= "-" . $random;
}
return $slug;
}
How can I make a random key instead of the post title?
I have not researched URL shorteners or redirection methods.
Any idea is welcome!