AddThis Academy

An ever-growing library of resources to help you become a better online marketer.

Setting the URL & Title to Share

To define the URL to share you do it in one of four ways. For our newest tools, use the data-url and data-title parameters, like this:

<div class="addthis_sharing_toolbox" data-url="THE URL" data-title="THE TITLE"></div>

If the code you’re using has the addthis_toolbox in it, use the addthis:url and addthis:title parameters, like this:

<div class="addthis_toolbox addthis_default_style " addthis:url="THE URL" addthis:title="THE TITLE">

Or you can set it using the addthis_share variable, which will change the URL and title shared for all the AddThis tools on the page:

<script type="text/javascript">
var addthis_share = {
   url: "THE URL",
   title: "THE TITLE"

In any case, be sure to replace THE URL and THE TITLE with the URL and title of the pages to share.

Instructions for WordPress

WordPress provides a way to grab the existing page URL and title, which is helpful when adding the code to a WordPress template. Here’s some example code that can be used within a WordPress template:

<div class="addthis_sharing_toolbox" data-url="<?php the_permalink(); ?>" data-title="<?php the_title_attribute(); ?>"></div>
Setting the URL & Title to Share
1 (20%) 1 vote

Was this article helpful to you?