Title: Converting hyperlinks and twitter users in twitter text
Last modified: August 20, 2016

---

# Converting hyperlinks and twitter users in twitter text

 *  [jammy to go](https://wordpress.org/support/users/jammy-to-go/)
 * (@jammy-to-go)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/re-hyperlinks-and-users/)
 * Hi,
 * Are there any built in functions that make the urls and twitters hyperlinked 
   that appear in the twitter messages ($tweet[‘text’])?
 * P.S. Nice little plugin and easy to implement.
 * [http://wordpress.org/extend/plugins/oauth-twitter-feed-for-developers/](http://wordpress.org/extend/plugins/oauth-twitter-feed-for-developers/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [msephton](https://wordpress.org/support/users/msephton/)
 * (@msephton)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/re-hyperlinks-and-users/#post-3553839)
 * I think the plugin should use the official WordPress method of adding links to
   tweet text.
    [https://github.com/mzsanford/twitter-text-php](https://github.com/mzsanford/twitter-text-php)
 * But a quick, though less comprehensive solution, would be to use this code:
 *     ```
       foreach($tweets as $tweet) {
         $tweet_text = $tweet["text"];
         $tweet_text = preg_replace('/http:\/\/([a-z0-9_\.\-\+\&\!\#\~\/\,]+)/i', '<a href="http://$1" target="_blank">http://$1</a>', $tweet_text); //replace links
         $tweet_text = preg_replace('/@([a-z0-9_]+)/i', '<a href="http://twitter.com/$1" target="_blank">@$1</a>', $tweet_text); //replace users
         echo $tweet_text;
       }
       ```
   
 *  Thread Starter [jammy to go](https://wordpress.org/support/users/jammy-to-go/)
 * (@jammy-to-go)
 * [13 years, 4 months ago](https://wordpress.org/support/topic/re-hyperlinks-and-users/#post-3553852)
 * Cool!
 *  Plugin Author [Liam Gladdy](https://wordpress.org/support/users/lgladdy/)
 * (@lgladdy)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/re-hyperlinks-and-users/#post-3553920)
 * We’re going to add this in the next release too 🙂

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Converting hyperlinks and twitter users in twitter text’ is closed to
new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/oauth-twitter-feed-for-developers.
   svg)
 * [oAuth Twitter Feed for Developers](https://wordpress.org/plugins/oauth-twitter-feed-for-developers/)
 * [Support Threads](https://wordpress.org/support/plugin/oauth-twitter-feed-for-developers/)
 * [Active Topics](https://wordpress.org/support/plugin/oauth-twitter-feed-for-developers/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/oauth-twitter-feed-for-developers/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/oauth-twitter-feed-for-developers/reviews/)

 * 3 replies
 * 3 participants
 * Last reply from: [Liam Gladdy](https://wordpress.org/support/users/lgladdy/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/re-hyperlinks-and-users/#post-3553920)
 * Status: not resolved