ExpressionEngine plugin to create short URLs.
Switch branches/tags
Nothing to show
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.



Shrimp is an ExpressionEngine plugin that provides URL shortening functionality. Shrimp is different from similar plugins in that it provides features like customizable link generation, access to the shortened URL for your own custom links, smart meta tags which hide themselves on non-entry pages, access to the relative URL (without the protocol or domain), and more, without any unnecessary database access.

Shrimp transforms long URLs like this:

into shortened URLs like this:

Shrimp then provides redirection from the shortened URL to the long URL through the use of a simple, one-line template.

It is recommended that you remove the “index.php” from your URLs as described here (although Shrimp will work either way).


As of version 1.5 Shrimp is compatible with both ExpressionEngine 1.x and 2.x branches


For EE 1.x

  • Copy the shrimp/pi.shrimp.php file to your system/plugins directory

For EE 2.x

  • Copy the shrimp directory to your system/expressionengine/third_party directory


Integrating Shrimp into your ExpressionEngine website is a straight forward process.

Create a new template group for the redirection. Give the group a short name, such as “u”, in order to keep the URL as small as possible (Shrimp will actually assume the default template group name “u” if you don’t specify one).

Paste the following line into the index template in the new template group. You must replace “weblog/entries” in the example below with the name of your individual entry view template:

{exp:shrimp:redirect template="weblog/entries" entry_id="{segment_2}"}

Add the following line to the HEAD block of your entry view template, replacing the template value with the name of the template group you created in the first step (or omit it and Shrimp will use “u”):

{exp:shrimp:meta_tag template="u" entry_id="{entry_id}"}

Display the short link on your site, within an {exp:weblog:entries} tag block. Shrimp can generate a full <a href> tag with a customizable title like this:

{exp:shrimp:link title="Short URL" template="u" entry_id="{entry_id}"}

This will generate an <a href> tag like this:

<a href="" title="Short URL">Short URL</a>

You can specify anything you want for the link title, such as the entry’s title:

{exp:shrimp:link title="{title}" template="u" entry_id="{entry_id}"}

This will generate an <a href> tag like this:

<a href="" title="My Entry Title">My Entry Title</a>

If you’d prefer to create your own custom links, you can access the shortened URL directly for use in your own links or for display using the “permalink” method like this:

{exp:shrimp:permalink template="u" entry_id="{entry_id}"}

This will output just the shortened permalink without the <a href> tag, like this:

If you just want to access the shortened path without the protocol (http://) and site name, you can call the “relative_url” method, like this:

{exp:shrimp:relative_url template="u" entry_id="{entry_id}"}

This will return just the path of the short URL, like this: