Shorty – Self Hosted Short URLs

8 min read

Shorty – Self Hosted Short URLs for Easy Social Share Buttons #

Shorty is a powerful add-on for Easy Social Share Buttons that allows you to create, manage, and track your own self-hosted short URLs directly on your WordPress website. No more dependency on third-party services like bit.ly or tinyurl.com.

Shorty – Self Hosted Short URLs add-on will be available with version 11.0 of Easy Social Share Buttons for WordPress

Shorty Free is only add-on for Easy Social Share Buttons for WordPress. Shorty Pro can be used as a standalone plugin for generating self-hosted short URLs or as an add-on for Easy Social Share Buttons for WordPress

Learn more about Shorty – Self Hosted Short URLs

Installation #

Free and Pro Version #

  1. Upload the shorty-essb-addon or shorty-pro-essb-addon folder to the /wp-content/plugins/ directory or use the WordPress plugin installer.
  2. Activate the plugin through the ‘Plugins’ menu in WordPress
  3. Go to Easy Social Share Buttons → Shorty URLs to configure the plugin (ESSB Short URLs if you are using pro as a top-level menu).

Pro Version #

  1. Upload the plugin files as described above
  2. Activate the plugin – pro features will be automatically enabled
  3. A “PRO Version” badge will appear in the plugins list and admin bar

Free Version #

The free version of Shorty can be also installed via the add-ons menu in Easy Social Share Buttons for WordPress.

Getting Started #

After activation, you’ll find “Shorty URLs” as a submenu under Easy Social Share Buttons in your WordPress admin menu. The plugin adds a settings page with three tabs (two in free version):

  • Settings – Configure how short URLs are generated and handled
  • Short URLs – View and manage all your generated short URLs
  • Analytics (PRO) – Detailed statistics and click tracking

Settings Tab #

The Settings tab contains all configuration options for how short URLs are generated and handled.

General Settings #

SettingDescriptionDefault
Auto-generate short URLsWhen enabled, a short URL will be created automatically for each new post when it is first published. Works with posts, pages, and other public post types.Disabled
Short URL lengthThe number of characters in the generated short code. Minimum 3, maximum 50 characters.5

Character Set #

Choose which characters to use when generating random short codes:

  • Lowercase letters (a-z) – Enabled by default
  • Uppercase letters (A-Z) – Enabled by default
  • Numbers (0-9) – Disabled by default

Note: At least one character type must be selected.

URL Settings #

SettingDescriptionDefault
Allow trailing slashesWhen enabled, short URLs with a trailing slash (e.g., /abc123/) will work the same as without slash (/abc123).Enabled
Redirect typeChoose how to handle the redirect: WP Redirect (301) – WordPress-based permanent redirect Server 301 – Server-level permanent redirect (fastest) Server 302 – Server-level temporary redirect Server 307 – Server-level temporary redirect (maintains request method)WP Redirect (301)

PRO Features #

SettingDescriptionPRO Only
URL prefixAdd a custom prefix to all short URLs. For example, setting “go” creates URLs like yoursite.com/go/abc123. This helps organize your short URLs and makes them more recognizable.PRO
Enable analyticsTrack detailed statistics for all short URL clicks including referrers, devices, browsers, operating systems, and hourly breakdowns.PRO

Post Types #

Select which post types should display the Short URL meta box in the editor. By default, Posts and Pages are enabled. You can enable short URLs for any public post type including custom post types.

Data Management #

  • Clear data on uninstall – When enabled, all short URLs and settings will be permanently deleted when the plugin is uninstalled. Disable this if you want to keep your data when deactivating the plugin.

Short URLs Tab #

The Short URLs tab displays a complete list of all generated short URLs with powerful search and management features.

Search and Filter #

Use the search filter at the top of the page to find specific short URLs:

  • Search by: Choose which field to search:
    • All fields
    • Short URL only
    • Destination URL only
    • Post title only
  • Enter your search term and click “Search”
  • Click “Clear Filter” to reset the search
  • Search terms are highlighted in the results for easy identification

Short URLs Table #

The table displays the following information for each short URL:

  • Short URL – The complete short URL (with prefix if configured). Click to open in a new tab.
  • Target – The destination URL and associated post title (if applicable).
  • Created – The date when the short URL was created.
  • Clicks – Total number of clicks (always tracked, even without analytics enabled).
  • Actions – Available actions for each URL:
    • Edit Post – Opens the associated post for editing (if applicable)
    • Delete – Permanently removes the short URL
    • Stats (PRO) – Opens detailed analytics for this specific URL

Create Custom Short URL PRO #

Shorty - Self Hosted Short URLs 5 - Documentation for Easy Social Share Buttons
Shorty - Self Hosted Short URLs 15

Pro users can create custom, memorable short URLs manually:

  1. Enter the Target URL you want to shorten
  2. Enter a Custom Short Code (letters, numbers, hyphens, and underscores only)
  3. Preview your custom URL as you type
  4. Click “Create Custom Short URL” to generate it

Note: Custom short codes must be unique. The plugin will warn you if a code is already taken.

Bulk Actions #

Select multiple short URLs using the checkboxes and use the bulk actions dropdown to delete multiple URLs at once.

Analytics Tab PRO #

The Analytics tab provides comprehensive statistics for all your short URLs. Note: Analytics must be enabled in Settings first.

Date Range Selection #

Choose the time period for analytics data:

  • Last 7 days
  • Last 30 days (default)
  • Last 90 days
  • Last year
  • Custom range – Select specific start and end dates

Statistics Overview #

Four key metrics are displayed at the top:

  • Total Clicks – All clicks in the selected period
  • Unique URLs Clicked – Number of distinct short URLs that received clicks
  • Avg Clicks per URL – Average click count across all URLs
  • Busiest Day – The day with most clicks and the count

Clicks Chart #

A beautiful line chart shows daily click activity throughout the selected period. Hover over points to see exact numbers.

Detailed Statistics #

Six data tables provide in-depth analysis:

  • Top 5 URLs – Best performing short URLs with click counts and percentages
  • Top Referrers – Where your clicks are coming from (Direct traffic, social media, other websites)
  • Device Types – Desktop vs. Mobile vs. Tablet breakdown
  • Browsers – Chrome, Firefox, Safari, Edge, etc.
  • Operating Systems – Windows, macOS, Android, iOS, Linux
  • Peak Hours – Hourly breakdown to see when your URLs get most traffic

URL-Specific Analytics #

Click the “Stats” button next to any short URL in the Short URLs tab to view analytics filtered for that specific URL only. The dashboard will show:

  • Statistics only for that URL
  • The Top URLs table is hidden (since you’re viewing one URL)
  • A header showing which URL you’re analyzing

Actions #

  • Export as CSV – Download all analytics data as a CSV file for further analysis in spreadsheets
  • Refresh – Reload the current data
  • Purge Analytics Data – Permanently delete all analytics data (requires double confirmation)

Using Short URLs in Post Editor #

When editing posts, pages, or other enabled post types, you’ll find the Short URL meta box in the right sidebar.

For New Posts (Not Yet Saved) #

Shorty - Self Hosted Short URLs 11 - Documentation for Easy Social Share Buttons
Shorty - Self Hosted Short URLs 16

If you’re creating a new post that hasn’t been saved yet, the meta box shows:

Save the post first to generate a short URL.

This prevents generating short URLs for unsaved drafts.

For Posts Without a Short URL #

When a post is saved but has no short URL yet:

  • A message “No short URL generated yet” is displayed
  • PRO Feature: Custom URL field appears – enter your own short code (optional)
  • Click Generate Short URL to create one

For Posts With an Existing Short URL #

Shorty - Self Hosted Short URLs 13 - Documentation for Easy Social Share Buttons
Shorty - Self Hosted Short URLs 17

When a post already has a short URL, you’ll see:

  • The complete short URL (with prefix if configured) – click to open
  • Click count
  • The raw short code
  • PRO Feature: “Custom” badge if it’s a custom URL
  • Delete button – removes the short URL

Generation Process #

When you click Generate or Regenerate:

  1. The button shows “Generating…” and becomes disabled
  2. AJAX request creates the short URL
  3. Success or error message appears
  4. On success, the page reloads to show the new URL

Custom URL Rules PRO #

  • Custom URLs can only contain letters, numbers, hyphens (-), and underscores (_)
  • No spaces or special characters allowed
  • Must be unique across all short URLs
  • Leave empty for auto-generated random code

Developer Functions #

Shorty provides several helper functions for developers to use in themes or other plugins.

Get Short URL for a Full URL #

🐘
<?php
/**
 * Get short URL for a given full URL
 * 
 * @param string $full_url The full URL to shorten
 * @param bool $force_new Force creation of new short URL even if exists
 * @return string|false Short URL or false on failure
 */
$short_url = shorty_get_short_url('https://example.com/very-long-url', false);

if ($short_url) {
    echo 'Short URL: ' . $short_url;
}
?>

Get Short URL for a Post #

🐘
<?php
/**
 * Get the short URL for a specific post
 * 
 * @param int $post_id
 * @return string|false
 */
$post_short_url = shorty_get_post_short_url(get_the_ID());

if ($post_short_url) {
    echo '<a href="' . esc_url($post_short_url) . '">Share this page</a>';
}
?>

Get All Short URLs for a Post #

🐘
<?php
/**
 * Get all short URLs for a specific post (useful if multiple exist)
 * 
 * @param int $post_id
 * @return array
 */
$short_urls = shorty_get_post_short_urls(get_the_ID());

foreach ($short_urls as $url) {
    echo '<li><a href="' . esc_url($url->short_url) . '">' . esc_html($url->short_url) . '</a> (' . $url->clicks . ' clicks)</li>';
}
?>

Delete a Short URL by ID #

🐘
<?php
/**
 * Delete a short URL by ID
 * 
 * @param int $url_id
 * @return bool
 */
$deleted = shorty_delete_short_url(123);

if ($deleted) {
    echo 'Short URL deleted successfully';
}
?>
 

Shortcode Usage #

// Display short URL for a specific URL
[ shorty_url url="https://example.com/long-url" text="Click here" ]

// Display short URL for current post
[ shorty_url post_id="123" text="Share this page" ]

// Display short URL with custom text
[ shorty_url url="https://example.com/long-url"]Custom Link Text[/shorty_url ]

Frequently Asked Questions #

Are short URLs tracked even without analytics enabled? #

Yes. Basic click counts are always tracked and displayed in the Short URLs table, regardless of whether detailed analytics is enabled. The analytics feature provides additional detailed breakdowns.

Why aren’t my short URLs with prefix working? #

After changing the URL prefix, you may need to flush your permalinks. Go to Settings → Permalinks and click “Save Changes” (you don’t need to change anything). This refreshes WordPress’s rewrite rules.

Can I use short URLs for custom post types? #

Yes. In the Settings tab, you can select any public post type where you want the short URL meta box to appear. This includes custom post types from other plugins.

What happens to short URLs if I delete a post? #

The short URL remains in the database but is no longer associated with a post. It will still redirect to the original URL. You can manually delete it from the Short URLs tab if needed.

Can I have multiple short URLs for the same post? #

Yes, but with caution. By default, the plugin prevents duplicate short URLs for the same post to avoid confusion. However, Pro users can create multiple custom URLs for the same post if needed (with confirmation).

Do short URLs work with query strings and affiliate parameters? #

Yes. The plugin respects query strings when generating short URLs. URLs with different query parameters are treated as different destinations and get their own short URLs.

How do I upgrade from free to pro? #

Simply upload the pro version files to your existing installation, overwriting the free version files. The plugin will automatically detect the pro files and enable all pro features. Your existing short URLs and settings will be preserved.

Why does the meta box say “Save the post first”? #

This prevents generating short URLs for unsaved drafts, which would create URLs pointing to non-existent permalinks. Save the post first to establish its permanent URL, then generate the short URL.

Can I export my short URLs? #

Pro feature. You can export analytics data as CSV, but for exporting the short URLs list itself, you can copy from the table or use a database backup tool.

What’s the difference between “Delete” and “Regenerate”? #

Delete removes the short URL completely. Regenerate removes the existing short URL and creates a new random one in its place. This is useful if you want to change the short code.

Documentation version 1.0 – Last updated: March 2026

What are your feelings