PHPackages                             bensomething/craft-dub - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. bensomething/craft-dub

ActiveCraft-plugin[Utility &amp; Helpers](/categories/utility)

bensomething/craft-dub
======================

Create Dub short links for your entries.

1.0.3(3mo ago)120MITPHPPHP &gt;=8.2CI passing

Since Mar 23Pushed 3mo agoCompare

[ Source](https://github.com/bensomething/craft-dub)[ Packagist](https://packagist.org/packages/bensomething/craft-dub)[ RSS](/packages/bensomething-craft-dub/feed)WikiDiscussions develop Synced 3w ago

READMEChangelog (1)Dependencies (3)Versions (6)Used By (0)

Dub
===

[](#dub)

Create Dub short links for your entries.

Requirements
------------

[](#requirements)

- A [Dub](https://refer.dub.co/bensomething) account (affiliate link) and API key. [Learn more.](https://dub.co/docs/api-reference/authentication#api-keys)
- Craft CMS 5.0.0 or later.
- PHP 8.2 or later.

Installation
------------

[](#installation)

To install the plugin, search for "Dub" in the Craft Plugin Store, or install manually using composer.

```
composer require bensomething/craft-dub

```

Then install the plugin via the Craft control panel under **Settings → Plugins**, or from the terminal:

```
php craft plugin/install dub

```

Configuration
-------------

[](#configuration)

1. Go to **Settings → Plugins → Dub** in the Craft control panel.
2. Enter your Dub API key. You can use an environment variable (e.g. `$DUB_API_KEY`).
3. After saving your API key, the **Domain** section will display a dropdown of your available domains.

Usage
-----

[](#usage)

Once configured, a **Short Link** panel will appear in the sidebar of any entry that belongs to a section with URLs.

- **Creating a short link:** enter a custom slug in the **Short Link** sidebar section and save the entry. If left blank, no short link is created.
- **Updating a short link:** update the short link slug in the sidebar and save. The existing Dub link is updated in place.
- **Deleting a short link:** a short link will be removed from Dub when an entry is deleted or when a short link slug is removed and the entry is saved.
- **Archiving a short link:** a short link will be archived in Dub when an entry is disabled.

Templating
----------

[](#templating)

Use the `dubLink(entry)` Twig function to output a short link in your templates:

```
{% set shortLink = dubLink(entry) %}
{% if shortLink %}
    {{ shortLink }}
{% endif %}
```

[![Dub plugin sidebar](resources/craft-dub-1.png)](resources/craft-dub-1.png)

[![Stable Version](https://camo.githubusercontent.com/4ea62f5d2df8ce0b8233ab9c769db67aaff644b2064941c95fc58e43ea4163d3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f62656e736f6d657468696e672f63726166742d6475623f6c6162656c3d737461626c65)](https://packagist.org/packages/bensomething/craft-dub)[![Total Downloads](https://camo.githubusercontent.com/7febea564851bfeeab62cee847c193aaf8e81476eb6699675f3722c70e984dfb/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f62656e736f6d657468696e672f63726166742d647562)](https://packagist.org/packages/bensomething/craft-dub)

###  Health Score

39

—

LowBetter than 85% of packages

Maintenance82

Actively maintained with recent releases

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

4

Last Release

93d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/1e62c094901d7c5d75b18d3a34478f63b2adefe61ca1e32e877f742216c4afe2?d=identicon)[bensomething](/maintainers/bensomething)

---

Top Contributors

[![bensomething](https://avatars.githubusercontent.com/u/48893?v=4)](https://github.com/bensomething "bensomething (42 commits)")

### Embed Badge

![Health badge](/badges/bensomething-craft-dub/health.svg)

```
[![Health](https://phpackages.com/badges/bensomething-craft-dub/health.svg)](https://phpackages.com/packages/bensomething-craft-dub)
```

###  Alternatives

[spicyweb/craft-neo

A Matrix-like field type with block hierarchy

393808.8k10](/packages/spicyweb-craft-neo)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

292943.4k27](/packages/craftcms-feed-me)[verbb/formie

The most user-friendly forms plugin for Craft.

100387.6k57](/packages/verbb-formie)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

53675.5k15](/packages/solspace-craft-freeform)[verbb/navigation

Create navigation menus for your site.

92698.4k18](/packages/verbb-navigation)[verbb/workflow

Enforce multi-step review processes for creating entries.

138123.0k1](/packages/verbb-workflow)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
