Blog

Personalising AddThis’s Tweet Button

AddThis is a quite useful WordPress plugin for adding a host of sharing options to your blog posts.

By default, the “Tweet” button that AddThis provides will append “via @AddThis” to the end of tweets, which seems to me a little uncool, given that it’s your content.

So, here’s a little plugin that lets you specify your own Twitter account name instead of @AddThis.

The principle is simple: AddThis were kind enough to define their own filter for the plugin’s output. The plugin plugs itself into this filter, and makes an adjustment to the Tweet button.

To use it, put addthis-modifier.php into your wp-content/plugins folder, open it up and set your twitter name where indicated. Activate it, and you should be good to go.

Download the plugin: AddThis Modifier Plugin

For extra marks: Here’s some code you can use to replace line 14 (the $twittername = … line) to provide a different Twitter account for each post author. Is that not awesome?:

    $accounts = array('Michael'   => 'MichaelTyson',
                      'Katherine' => 'NellieWindmill');
    $twittername = $accounts[get_the_author()];
Tagged , , , , . Bookmark the permalink. Both comments and trackbacks are currently closed.

3 Comments

  1. Posted December 31, 2011 at 6:45 am | Permalink

    I love you, I love you, I love you! Thank you so much for this nifty little plugin :)

  2. Posted March 11, 2012 at 10:55 am | Permalink

    Hi Michael,

    Thank you for making this, it is a real problem with WordPress!

    Unfortunately it resulted in double @@ symbols on my username (and I ensured I didn’t include it in the config file for your plugin) so I had to disable it. I just thought I would let you know.

    Gem