Shorten WordPress’ Jetpack Sharing Links (

EDIT: I have since developed a more robust solution for using shortlinks in Jetpack. See this updated information in Jetpack Sharing Links Revisited.

When I first decided to use WordPress for my personal as well as professional CMS needs, one of the driving factors behind that decision was the Jetpack plugin, developed by WordPress, which allows off-site ( installations to use many of the fancy features that used to only be available on blogs.

The Jetpack plugin allows you to quickly and easily share to multiple social networks, get site statistics, enhances your site for smartphone viewers, and many other convenient things. The one thing I do not like about the system is how difficult it is to retrieve the shortlinks, which are another fancy feature that Jetpack offers. Unfortunately, the links are only obtainable through the admin side, and not used in Jetpack’s own social sharing buttons (see below). If you try clicking any one of the share buttons at the bottom of this post, you’ll notice the link is to the URL of this page, not the shorter version which is preferred for sites like Twitter, where every character is a commodity. At least, that used to be the case.

WordPress Jetpack - Sharedaddy
Example of what the Sharedaddy share links look like.

After reporting this for revision a few months ago and getting the run-around, I finally took the time today to make the necessary changes myself. I also submitted a ticket to the WordPress team which *fingers crossed* will result in the change being pushed to all Jetpack users some time in the future. EDIT: This ticket was recently rejected, but that doesn’t stop you from implementing the fix yourself!

In the meantime, anyone interested in implementing the fix themselves…

It’s extremely simple to do once you know where to look. In fact, the entire fix only requires changing two function calls; let’s get started!

The first thing you need to do is download the latest version of Jetpack (as of writing this, that’s v2.1, but that link will always link to the most recent release).

Once you’ve got the latest version and extracted the ZIP file to a folder, you need to navigate to /modules/sharedaddy/ (starting in the root of the jetpack folder). From there, open up sharedaddy.php in your favorite text editor and search for the sharing_email_send_post function. Within the function, change get_permalink to wpme_get_shortlink. When you’re finished, it should look something like this:

This function is just responsible for handling the link sent if people click the email share button. For everything else, we need to look in a different file, so save this one and exit.

Now, open up sharing-sources.php, which is in the same directory as the other file. This time, look for the get_share_url function. Within it, you’re going to again swap the call to get_permalink to instead call wpme_get_shortlink. When you’re finished, the function should look something like this:

And that’s it! You’re done. Now just access your WordPress install plugin directory and go to the jetpack folder (most likely something like: The structure of this folder is exactly the same as the one you downloaded, but you only need to reupload the two files you edited, so go into the /modules/sharedaddy/ folder within jetpack and copy in your two edited files.

Now go and try it out. If everything went how it’s supposed to, you should find that if you click any of the Jetpack share links that you get a shortlink instead. Enjoy!

Feel free to post questions or updates if something changes in a future release of Jetpack.

4 thoughts on “Shorten WordPress’ Jetpack Sharing Links (”

  1. thanks for responding, i tried the new way and it still didn’t work for me, i’m not sure if its something i’m doing wrong…here what i did: i copied the sting of text that you shared with us for the new fix, and pasted it in my function.php at the top after the <?php (not sure if thats where is goes or not), but after saving it and testing the twitter share, there was no share link just the title of the post…can you please let me know what i am doing wrong??

Leave a Reply