BCTT Tutorial: Using a URL Shortener to make links trackable.

As of version 3.0, The Better Click To Tweet plugin now supports the option to use the built-in WordPress shortlink system.

While this doesn’t change the allowable number of characters in the tweet (my plugin does the math based on Twitter’s built-in and unavoidable t.co shortened URL length), it does allow you to use the plugin alongside other plugins which modify the WordPress shortlink using services like bit.ly or yourls.org.

I am using a custom YOURLS.org shortener at http://benlikes.us for my shortened links, so I’ll teach you how to set that up, and also how to set up a bit.ly plugin I recommend. For Bit.ly instructions, skip to that section below.

Set up Better Click To Tweet and yourls.org

The plugin I recommend for use with yourls.org-powered shortlinks is YOURLS Link Creator, though it hasn’t been updated in a while.


This tutorial assumes you’ve already got a functioning YOURLS install


The first step is to install both plugins, and configure the settings in both plugins. For that you’ll need your Yourls secret signature token found in the admin -> tools section of your YOURLS install.
Untitled design (6)
Copy and paste that token into the setting page on the YOURLS Link Creator settings page at wp-admin/options-general.php?page=yourls-settings

Untitled design (6)

Make sure to check the box labeled “Use YOURLS for Shortlink.”

Now, in the Better Click To Tweet settings at wp-admin/options-general.php?page=better-click-to-tweet, make sure to check the box labeled “Use Short URL?

Untitled design (7)

Set up #WordPress Click To Tweet boxes with yourls.org link shortening in 5 minutes! Click To TweetYou’re done! Now the plugins will work together to deliver trackable links through YOURLS!

To ensure everything is working, click a Better Click To Tweet box in a post, and verify that the short URL is being delivered. If you are using a caching plugin or a CDN, make sure to empty the cache and update the CDN with all the applicable plugin files!

If you are having any issues, start a support thread on the WordPress.org forums. I actively answer those.

If you’ve found this tutorial (and my plugin) helpful, the best ways to show it are to donate, review, and share about it using the box above!

Set up Better Click To Tweet and bit.ly

The plugin I recommend for creating bit.ly shortlinks is WP Bitly.

Once you’ve installed and activated both plugins, go to the WP Bitly settings near the bottom of the Writing Settings page at wp-admin/options-writing.php and insert your bit.ly OAuth Token. You can find that token by following the link on that page to https://bitly.com/a/wordpress_oauth_app and copy/pasting.

Untitled design (7)

Once you’ve done that (don’t forget to save the settings), head over to the Better Click To Tweet settings at wp-admin/options-general.php?page=better-click-to-tweet, make sure to check the box labeled “Use Short URL?

Untitled design (7)

You’re done! Now the plugins will work together to deliver trackable links through bit.ly!

To ensure everything is working, click a Better Click To Tweet box in a post, and verify that the bit.ly URL is being delivered. If you are using a caching plugin or a CDN, make sure to empty the cache and update the CDN with all the applicable plugin files!

If you are having any issues, start a support thread on the WordPress.org forums. I actively answer those.

Set up #WordPress Click To Tweet boxes with bit.ly link shortening in 5 minutes! Click To Tweet

If you’ve found this tutorial (and my plugin) helpful, the best ways to show it are to donate, review, and share about it using the box above!

Similar Posts

One Comment

Comments are closed.