How to Customize Inline Share Buttons (Image, URL, and more)

Looking to customize the title, description, image, or URL that’s displayed when a user shares content on your website? You came to the right place! (If you want to learn how to customize your Sticky Share Buttons, go here)

Oftentimes, the Open Graph Protocol tags will populate this information with content from your page but you can tailor it to make it more relevant if it’s not extracting the information you want it to. For example, if a user shares your homepage, you may want to add an image of your product or provide a more compelling description. 

Properties in <div> tags

You can specify the URL, title, image, and description that’s shared by adding the following tags in the tool placement code <div class=”sharethis-inline-share-buttons”></div> wherever you want the ShareThis tool to appear. 

data-networkSpecifies to which social platform the content will be shared
data-urlSpecifies URL (can be shortened URL) that you would like shared
data-short-urlSpecifies a shortened URL that can be used in conjunction with the data-url
data-titleSpecifies title that you would like shared (email’s subject in some email channels)
data-imageSpecifies link to image you would like displayed in the shared content
data-descriptionSpecifies summary text/description you wish to share
data-usernameSpecifies your Twitter username
data-messageSpecifies the body copy of e-mail shares
data-email-subjectSpecifies the email’s subject

Example: This button is set to share the ShareThis home page with the title “Sharing is great!”<div class="sharethis-inline-share-buttons" data-url="https://sharethis.com" data-title="Sharing is great!"></div> 

Notes

  • This customization is not available for all social channels.
  • The data-url attribute will help you set a specific URL (despite which page users are sharing) or add a tracked link.

Order of Precedence

It is important to remember the order of precedence by which the ShareThis code processes share properties. Generally, we recommend using one approach by which sharing properties are specified on your pages to prevent errors.

  1. Any dynamically specified JavaScript properties (i.e. highest precedence)
  2. Properties specified in tags (i.e. second precedence)
  3. Open Graph Protocol tags (i.e. lowest precedence)