A self-hosted short URL plugin for WordPress. Available on GitHub.
Configuration
There are three configuration options:
-
Short URL domain
Fairly self-explanatory – the domain which you wish to use for your short URLs -
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 atarh.im/lb
. -
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.