Custom Tweet Button without URL?


Hello! I’m creating a custom tweet button. Sometimes the URL will be inside of the “message”, so I don’t want it appended at the end of the tweet (the only behavior I can get from Twitter).

Hey, go to for details!

To accomplish this, I open a window with JS and set url to false:

function tweet (message) {''+encodeURIComponent(message)+'&url=false', 'Tweet');

In most cases this works fine. Sometimes, though, the word “False” gets appended to the end of the tweet. I haven’t been able to recreate this myself but I have seen it on many tweets from my site.

Is there a guaranteed way to do this? says that if you don’t include any url, it will use the url of the page (not even the right URL, and appended at the end).

Tweet button with NO URL in the tweet? this post says to just set the url to something incorrect, like http://wrong but I think showing false is better than possibly showing a strange link…

Are tweets not supposed to contain a link in the middle of the message? Are they not supposed to be tweeted without a URL at the end?

Any insight appreciated. Thanks.


Hey, you can use the Twitter share intent as follows:

function tweet(message) {'' + encodeURIComponent(message), 'Tweet');

Just omit the URL all together.


Thanks @ePirat that appears to be the ticket. I wonder why url was not always optional like this.

closed #4