Did you know that WordPress has a function ‘make_clickable’ which converts plain text URLs to HTML links? It converts URI, www, ftp, and email addresses to clickable hyperlinks and also helps by fixing links within links.
To make use of this function in the most effective manner, edit your theme’s functions.php file and add the following line:
The above code will automatically make all links clickable in your post content. If you want the returned content to be used some place else,
$theContent = make_clickable(get_the_content( ) );
// Then, echo it wherever you wish to display the content