Preview short URL’s in comments

Yesterday Keith Dsouza wrote in Weblog Tools Collection about the problem with short url in comments which are used by spammers to try to get their comments approved.

The problem with short urls is that in order to know where the link points you have to click on it with the risk of being sent to a malware site or something else. Or you can use another web service to expand the URL and check the destination but you have to open another browser tab, copy the URL from the comment and paste it into the other tab.

If you have a site with a lot of comments it’s difficult to check every one and that’s why Keith proposed the idea of a plugin to handle this. I thought that it would be easy to create a plugin to do that and after a bit of research I found that has a jQuery plugin that does precisely what I needed for the plugin.

With that jQuery plugin it took me less than 30 minutes to create the first version of the Preview Comments Short URL plugin for wordpress.

After installing the plugin, in the comments administration page you get a link next to each short URL to expand it for preview.

It works with most of the short URL’s I tried, and LongURL is constantly adding support for URL shorteners.

Download the Preview comments short URL plugin from the WordPress plugin repository.

2 thoughts on “Preview short URL’s in comments

  1. If I understood how this works, it gets list of services from LongURL then search page for links to those domains and if there is a match it adds “expand” next to it? Am I correct?

    Great to see that you load JavaScript and CSS properly ;)

    (btw, I suggest you to install some comment notification via e-mail plugin here for easier tracking of replies)

    • Yes, that’s exactly what it does.

      Thanks for the comment and I’ll install comment notification later.