Disclosure: Please note that links to merchants mentioned within this post might be using an affiliate link which means that - at zero cost to you - I might earn a commission if you buy something through that affiliate link. That said, I never recommend anything I don’t personally use and find to be a valuable asset to my business.

How To Easily Create Your Own URL Shortener With WordPress


  1. John Razmus says:

    Not sure how old this article is, but it’s worth noting that your example has a security vulnerability in it:

    $result = mysql_query(“SELECT * FROM wp_linkshortcut WHERE
    url=’http://outspokenmedia.com” . $_SERVER[“REQUEST_URI”] . “‘”);

    That line is inserting whatever’s in the url directly into a mysql query, which allows a savvy malicious person direct access to your database (called mysql injection). With that, they can run whatever crafty queries they want, including and up to deleting the entire database.

  2. Bradley Anderson says:

    I was going to point out the same vulnerability, but Mr. Rasmus beat me to the punch several months back. :) I just went back and noticed this post was from early 2009.

Leave a Reply

Your email address will not be published. Required fields are marked *