Skip to main content
CodeNerd-stream

Make a “Share on Twitter” link with URL and Hashtags

By February 19, 201311 Comments

Make a "Share on Twitter" link with URL and Hashtags - Mahoney Web MarketingThis is a little coding trick I get asked about quite a bit.

The link you have to make to share something to Twitter is quite simple:

http://twitter.com/share?text=text goes here

But getting a URL and hastag in there is a different matter. To be honest most developers do know how to include the URL, but hashtags have proved more elusive!

http://twitter.com/share?text=text goes here&url=http://url goes here&hashtags=hashtag1,hashtag2,hashtag3

Here’s an example to try out:

http://twitter.com/share?text=Here’s an awesome tip!&url=https://mahoneywebmarketing.com/make-a-share-on-twitter-link-with-url-and-hashtags/&hashtags=peter,is,awesome

And that’s it!

Author Peter

More posts by Peter

Join the discussion 11 Comments

Leave a Reply

Exit mobile version