bevanb
bevanb

Reputation: 8531

Twitter button do not append site URL

<a class='twitter-share-button' href='https://twitter.com/intent/tweet?text=My%20Message' data-size='large' data-url=''>Tweet</a>

This works great, EXCEPT it adds "http://localhost:3000" at the end of my tweet, even though I specify data-url=''.

How can I get it to not add the URL of the current site at the end?

Upvotes: 0

Views: 79

Answers (1)

Derek Hopper
Derek Hopper

Reputation: 2258

Try this:

<a class='twitter-share-button' href='https://twitter.com/intent/tweet?text=My%20Message&url=/' data-size='large'>Tweet</a>

If you specify a url of / as a query param, it won't include a url in the tweet. I'm not quite sure why it works that way, but it does.

Upvotes: 1

Related Questions