Twitter Friendly Links
Thank you for using Twitter Friendly Links.
Description
So, you promote your blog posts via Twitter, huh? Me too. And those long blog post URLs, ugh! Yeah, we got rid of those using URL shortening services like TinyURL and tr.im but what about the name and/or brand? Your blog posts might be fab – very interesting to read and three thousand comments on each. But are you getting people to remember your website address in Twitter? No. Do you get backlinks from Twitter using TinyURL? No. Can you measure site statistics from TinyURL links on Twitter? No.
Link Wisely, with WordPress

Here’s a quick example:
http://kovshenin.com/wordpress/plugins/twitter-friendly-links/
Might look like this in Twitter:
http://kovshenin.com/712
Sweet huh? Here’s a features list:
- Easy to install
- Customizable shortened URL style
- Switch between 302 and 301 redirects
- You can have a list of all your posts/pages/attachments together with their Twitter Friendly URLs on one page (AJAX pagination)
- Shows the short link in the edit post/page form together with the text you can tweet out (trimmed to 140 characters) and a link to Twitter with the predefined text
- You can output the twitter friendly link in your themes using the twitter_link() function
- Compatible with Sociable, Twitter Tools, Tweet This, SexyBookmarks and AskApache Google 404 plugins
- Configurable linking relations (HTML and HTTP) for rel=shortlink and rel=canonical
- Compatible with WordPress MU and BuddyPress
- Super easy tracking with Google Analytics! Destination links are Taggable!
- You can now switch to alphanumeric links for sexy links with numbers and letters like http://example.com/s2e7
- Caching with .htaccess now available!
- Even shorter links with customizable shortlink base!
- Loads more yet to come
Screenshots
Download, changelog and other notes
Download link, changelog and other notes. Officially hosted in the WordPress.org Plugin Directory: Twitter Friendly Links. I also like when people with WordPress.org accounts vote it up ;) thanks!
Even Shorter!
The new version of Twitter friendly links includes a customizable shortlink base URL. This is used in case you want your twitter links to be on a different URL than your blog. This is useful when you run your blog on a www domain name but want your short links to be without the www to save some space. Changing the base URL is also useful when your domain is too long and you have a shorter one that you would like to use for twitter links, for instance if you own yandex.ru and ya.ru, you might host all your blog on yandex.ru, but your shortlinks would be ya.ru/123 which would redirect to the original post at yandex.ru.
Enabling this is fairly simple, no coding skills required. Both domains should use the same .htaccess file, thus you should direct your new domain (virtual host) to the same root folder as your old one.
Please supply any feedback to the comments section of this page. Pingbacks and trackbacks are appreciated too. Thanks for all your contribution.
Translations
- Turkish description by Ömer Taylan Tuğut
Shortlink: http://kovshenin.com/712














Actually, nevermind, I found a solution :)
For our site, I’m using this bit of .htaccess code:
RedirectMatch 301 ^/(.*)$ http://wpvibe.com/?p=$1
And the WP engine does the rest :)
Thanks!
hey Konstantin! thanks for sharing your amazing work!
I love your plug-in, i use it in several websites, but since i updated to wordpress 2.8.6 all my links are broken.. i get a 404 for all short links, in all websites.
let me know if you plan to release a update!
thank you!
peace,
Guigo
Howdy Guigo,
Thanks for the plugin luv, sorry to hear about that, I haven’t tested it on updates but the only thing I could think of right now is some permalinks problem. Which version of Twitter Friendly Links are you using, and if it’s the latest, have you tried enabling caching in .htaccess? (Note that your .htaccess file should be writable at all times).
Cheers,
K.
Hi, I am not sure if there has already been a solution for this problem so maybe you can tell me if there is and what it is. People on Twitter complain that my shortlinks do not work and go to a Not Found page.
Example of my shortlinks: http://chinasmack.com/12506
I am using the fixes for Twitter Tools and Sociable. I am also using W3C Total Cache for my caching but I think I have the same problem before with Super Cache and Hyper Cache.
I test this using Firefox Private Browsing. When I paste a shortlink, the first time I open it, it works. But when I try to reload or open it again, it becomes Not Found. I do not know why this happens. Is there a solution for this problem? Thank you for your help!
Hey, yeah the problems are at the caching plugins compatibility. One good way of fixing this is enabling .htaccess caching in Twitter Friendly Links settings. Note that your .htaccess file has to be always be writable. I’m planning on removing the old style linking anyway and use only .htaccess in a future version.
Cheers.
What permission should I change .htaccess to? 777? Is this safe?
Yeah 777 will work for sure.
Everything depends on your server’s configuration though. If it’s running mod_suphp via php-cgi then 644 should be fine, or even 640. If it’s running the standard mod_php then it depends on the owner of the .htaccess file. If the owner is apache, then 644/640 should work, if it’s not then 777 is the only key.
I wouldn’t worry about security issues unless you have root access to the server and could modify a few polices. If you don’t then the administrators should have done that for you ;)
Cheers, and let me know if you solve this one.
Hi, I used 666 since you say it must be “writable” but if you say 644 or 640 will work, then maybe I do not need that. Anyway, I test it again in Private Browsing and the 5 shortlinks I tested earlier still do not work. However, all of the other shortlinks that I did not test before earlier today DO work. So this is still very strange. It should not be a browser cache issue because I am using Firefox Private Browsing, right? If it is, I also try to refresh and reload too. I check the htaccess file and the rewrite rules are there for those shortlinks too.
Did you clear your W3 Total Cache?
I clear it and now it works! Thank you! Russians are great people!
You’re welcome ;) there is one tiny issue though with “scheduled posts” at the mo, the rewrite rules are not being written immediately but that’ll be fixed soon ;)
Cheers!
I tried that and my links come through odd (but work).
For example:
http://www.dswfoto.com/blog/105
links to:
http://www.dswfoto.com/blog/blog/http://www.dswfoto.com/blog/engagement-photography/...
instead of
http://www.dswfoto.com/blog/engagement-photography/...
Wow, that’s very odd Kevin.. Please send me a screenshot of your Twitter Friendly Links settings so I could investigate that, thanks.
Any thoughts of specifically integrating this with Yourls? Currently it just grabs a hexidecimal URL to assign. I would love for it to grab the next URL from Yourls in order.
Thanks for this though. I like it.
Nice thought Andy, I’ll see what I can do.
A fantastic plugin that I have been using for a couple weeks now! I’m going to be blogging about it tomorrow to help spread the word!
Thanks Erica, that’s so nice of you!
I installed the plugin and left most of the configuration with the defaults, but it does not seem to be working. I posted a short comment to twitter this morning and it still showed up on the blog as a ity type posting….
I have no idea where to start finding the problem…any suggestions would be appreciated.
Try playing with the configurations a little bit and read the installation docs, it should be pretty straightforward.