Drupal is a registered trademark of Dries Buytaert
drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)! drupal 10.6.8 Update released for Drupal core (10.6.8)! drupal 11.3.9 Update released for Drupal core (11.3.9)! drupal 11.3.8 Update released for Drupal core (11.3.8)! drupal 11.3.7 Update released for Drupal core (11.3.7)! drupal 11.2.11 Update released for Drupal core (11.2.11)! drupal 10.6.7 Update released for Drupal core (10.6.7)! drupal 10.5.9 Update released for Drupal core (10.5.9)! cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)!

shorturl

27 sites Security covered
View on drupal.org

A URL shortener for Drupal built on node entities, with QR code generation, visit tracking, statistics, and a REST API.

Features

  • Short URL content type with three slug modes: custom vanity slugs, random base36 slugs, or sequential auto-increment slugs
  • Automatic redirects via the Redirect module — redirects are created and synchronized when short URLs are saved or deleted
  • QR code generation (PNG and SVG) using endroid/qr-code, accessible via /api/shorturl/qr/{slug} endpoints
  • Visit tracking via a lightweight HTTP middleware that records visits without bootstrapping Drupal on cached requests
  • Statistics dashboard on each short URL node with traffic charts, referrer analysis, and country-of-origin mapping
  • REST API for programmatic URL expansion and statistics retrieval
  • Views integration with a pre-configured admin listing
  • Granular permissions for slug modes, statistics viewing, API access, and administration
  • Browser cache control with an optional no-store header on redirects for accurate visit counting
  • Multi-language support — per-translation redirects with language-neutral fallbacks
  • Optional country detection via the Smart IP module
  • Multi-domain support via the separate Domain Short URL module (requires the Domain module)

Requirements

Installation

composer require drupal/shorturl
drush en shorturl

Configuration

Navigate to Administration > Configuration > Short URL settings (/admin/config/shorturl/settings) to configure:

  • Base36 slug length (4–12 characters)
  • Default redirect status code (301, 302, or 307)
  • Destination type (external only, or both internal and external)
  • QR code format (PNG or SVG)
  • Visit tracking (enable/disable)
  • Browser cache control (no-store header on redirects)

Slug modes

Each short URL uses one of three slug modes, controlled per-node and restricted by permissions:

Mode Permission Example Custom Use custom short URL slugs promo Base36 Use base36 short URL slugs k9m2x7 Auto-increment Use auto-increment short URL slugs 42

REST API

All API endpoints require the Access Short URL API permission.

Endpoint Description GET /api/shorturl/expand/{slug} Expand a slug to its destination URL GET /api/shorturl/stats/{nid} Visit statistics for a short URL GET /api/shorturl/db-stats Aggregate database statistics

QR codes

QR code images are available at:

  • /api/shorturl/qr/{slug} — default format (configured in settings)
  • /api/shorturl/qr/{slug}/png — PNG format
  • /api/shorturl/qr/{slug}/svg — SVG format

Documentation

Full documentation is available at the project documentation site.

Previous module

This project namespace was previously used by an unrelated Drupal 6/7 module developped by the Phase2 Technology company. The original code is still available in the 6.x-1.x branch. The original project was not covered by the Security Advisory Policy.

Activity

Total releases
6
First release
Apr 2026
Latest release
1 month ago
Release cadence
0 days
Stability
17% stable

Release Timeline

Releases

Version Type Release date
2.0.0-alpha4 Pre-release Apr 13, 2026
2.0.0-alpha3 Pre-release Apr 13, 2026
6.x-1.0 Stable Apr 13, 2026
2.0.0-alpha2 Pre-release Apr 13, 2026
2.x-dev Dev Apr 13, 2026
2.0.0-alpha1 Pre-release Apr 13, 2026