Simple URL shortening

Fund package maintenance!

Installs: 6 514

Dependents: 0

Suggesters: 0

Security: 0

Stars: 10

Watchers: 4

Forks: 2


4.0.0 2022-07-19 02:30 UTC

This package is auto-updated.

Last update: 2022-10-29 02:26:39 UTC


Lets you create short links for elements or arbitrary URLs.


You can install Shortcut via the plugin store, or through Composer.

Craft Plugin Store

To install Shortcut, navigate to the Plugin Store section of your Craft control panel, search for Shortcut, and click the Try button.


You can also add the package to your project using Composer and the command line.

  1. Open your terminal and go to your Craft project:
cd /path/to/project
  1. Then tell Composer to require the plugin, and Craft to install it:
composer require verbb/shortcut && php craft plugin/install shortcut


To create a short url for an 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',

You can also control the length of the unique hash generated using the hashLength option.

return [
    // Set the hash length
    'hashLength' => 12,


Originally created by the team at Superbig.

Show your Support

Shortcut is licensed under the MIT license, meaning it will always be free and open source – we love free stuff! If you'd like to show your support to the plugin regardless, Sponsor development.