How to add text after URL, in default text?


Is it possible to add text after shared URL?

For example, I want to share this:

“Share this URL:! Thanks! #Example

so in tag for link I have:

href=“” class=“twitter-share-button” data-lang=“en” data-text="Share this URL: " data-hashtags=“Example” data-url=“

and this is giving me the output:

“Share this URL: #Example

Is it possible to add additional text, after the URL is written?



The url parameter will always be appended after the text. If you wanted to share a custom string, you could just set data-text=Share this URL: Thanks! rather than the separate parameter.



But in that case I have this format of text that is shared:

Share this URL: Thanks!

the current URL is also appended at the end, even if it’s not set up as data-url. In my text I want the URL to appear only one time.


Ah, I see. Yes, the share button will always take the current URL is none is provided. There’s not a way to disable the url parameter in this case.

An alternative would be to use the Hashtag button variation:

Or, you could use your own link to the Intent directly, configuring the URL parameters as you please.

Keep in mind that the text you’re setting up is going to require the user to edit it before they can share, I’m not sure how much you’re going to gain with the tweaks. The text part will be auto-selected in the browser, with the URL and Hashtag not, so that the user will type over the placeholder text but not the URL itself. With your alternate formatting you increase the amount of effort someone has to take to actually share the link, which we know from experience will result in less shares.



I want the tweets to be as more user-friendly as possible. So because of that I changed the format of the tweets. I won’t append text after the URL is shown.

Thanks. :slight_smile: