How To Change via @sharethis in the WordPress Plugin

Skip the prose and go straight to the code. ShareThis is a very popular if not the most popular social sharing service on the web, you can find it on this site and many other sites from the SEO and web design industries, social media and just about any area of the web that uses social media to incentivise users to share content on Twitter, LinkedIn, Google+, Facebook and countless other social networks. A couple of random examples are Forbes and the RTP Portugal’s main TV channel.

How To Change via @sharethis - Google Search

The two sites above are just some examples where the via @sharethis, when sharing on Twitter is set up by default to attribute the content and generate a twitter mention, to SahreThis and not the site creating the content. This is just frustrating for site owners as the screenshot above shows, a very large number of people search for “How To Change via @sharethis” on Google.
Not even Forbes managed to get this right.

Forbes ShareThis

In the WordPress plugin go to the options panel and locate:
+Click to view/modify the HTML tags
That will expand and you will find something similar to the image below.

ShareThis Options WordPress Plugin

Your code should look like the span tag below.

<span class='st_twitter_hcount' st_title='<?php the_title(); ?>' st_url='< ?php the_permalink(); ?>' displayText='twitter'></span>

Insert the following code anywhere within the span tag, at the end would probably be easier to locate.

st_via='pedro_matias'

Obviously change “pedro_matias” to whatever your “username” is.

<span class='st_twitter_hcount' st_title='<?php the_title(); ?>' st_url='< ?php the_permalink(); ?>' displayText='twitter' st_via='pedro_matias'></span>

You may also want to add it to the main ShareThis button if you’re using it. As in the image above.

In order to remove the via altogether add:

st_via=''''

(That’s two single quotes followed by a double quote). The above comes from the ShareThis forum.

Conclusion

This works for WordPress, but it is very, very fiddly, at least in my case, really; I just wish that ShareThis (in case any of you reads it) provided as simple way to make the change hard coded in the plugin rather than try and get unwarranted Twitter mentions. Plugin which by the way, with every update gets buggier and buggier with share counts changing wildly from visit to visit. Although, in truth there’s probably nothing better around.

Anyhow, let me know if you found this helpful. Ah, and share… THIS!

Update: As of yesterday, 19/07/12 this post is pretty much redundant. Unless your’re using earlier versions of the plugin, version 5.2.1 released yesterday added: “Ability to promote your twitter handle using the ‘via’, ‘related’ options on the Twitter share button”. Good work ShareThis!

About Pedro Matias

A central London SEO consultant and private tutor, also specialises in WordPress web design and training. All SEO, web consulting and training approaches are centered on user experience, minimalism, speed and engineering centric design. Runs 10K for lunch most days for fun and health.
This entry was posted in Wordpress. Bookmark the permalink.
  • Mariak

    Hi, How do i change via sharethis in Joomla website?

    • Bradleydanielelliot

      is this really effected in widget area?

  • http://pedromatias.co.uk/ Pedro Matias

    On this site it works via the WordPress plugin, which is achieved by simply ticking a box. That option is fairly recent and appeared in one of the plugin updates released after this post was written.

  • http://twitter.com/scott_benson Scott Benson

    Have you guys seen anyone who has gotten this to work for the floating share bar on the left of your page?  

  • http://pedromatias.co.uk Pedro Matias

    You can put st_via=”” within the script tag, that should work!  

  • Carlos

    Ok..I guess it works, but since I am not using span tag, but script tag as suggested  in this article: 
    http://forums.sharethis.com/topic.php?id=77987 .  How do I insert the code to eliminate the @sharetis..