Shortbread

A self-hosted short URL plugin for WordPress. Available on GitHub.

Configuration

A text box for your short domain, and toggles for link redirection and link menu options
The Shortbread admin screen

There are three configuration options:

  1. Short URL domain
    Fairly self-explanatory – the domain which you wish to use for your short URLs

  2. Redirect links
    If you use WordPress links, you can use Shortbread as a URL shortener for any webpage you want. For example, this page exists at arh.im/lb.

  3. Force Links menu
    As of WordPress 3.5, the links menu doesn’t show up if you’re not using bookmarks. Turn this on to force that menu option to show up.

Usage

Shortbread introduces a new function – has_shortlink() – which tries to indicate whether a short URL is available in your current context. This allows you to put things like this in your templates.

<?php if (has_shortlink()): ?>
<link rel="shortlink" href="<?php echo wp_get_shortlink(); ?>">
<?php endif; ?>

Otherwise, just use wp_get_shortlink() or the_shortlink() as before. Shortbread tries to stay out of the way as much as possible.