Simple URL shortening
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Shortcut plugin for Craft CMS 3.x

Simple URL shortening



This plugin requires Craft CMS 3.0.0-beta.23 or later.


To install the plugin, follow these instructions.

  1. Open your terminal and go to your Craft project:

     cd /path/to/project
  2. Then tell Composer to load the plugin:

     composer require superbig/craft3-shortcut
  3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Shortcut.

Shortcut Overview

Let's you create short links for elements or arbitrary URLs.

Using Shortcut

To create a short url for a element:

{% set shortcut = craft.shortcut.get({ element: entry }) %}
{{ shortcut.getUrl() }}

To create a short url for a url:

{% set shortcut = craft.shortcut.get({ url: '' }) %}
{{ shortcut.getUrl() }}

By default, short urls is in the format xxxx.tld/s/aBC123. If you want to change the url segment from s to something custom, you can add a config file called shortcut.php in craft/config to override it:

return [
    // Override Shortcut URL segment
    'urlSegment' => 'x',

If you want to remove the url segment completely and get urls like xxxx.tld/aBC123, you can enable the hideUrlSegment option.

return [
    // Hide url segment
    'hideUrlSegment' => true,

To use a custom domain, add the domain with the customDomain option.

return [
    // Set custom domain
    'customDomain' => 'https://cool.domain',

Brought to you by Superbig