Drupal is a registered trademark of Dries Buytaert
cms 2.1.1 Update released for Drupal core (2.1.1)! drupal 11.3.6 Update released for Drupal core (11.3.6)! drupal 10.6.6 Update released for Drupal core (10.6.6)! cms 2.1.0 Update released for Drupal core (2.1.0)! bootstrap 8.x-3.40 Minor update available for theme bootstrap (8.x-3.40). menu_link_attributes 8.x-1.7 Minor update available for module menu_link_attributes (8.x-1.7). klaro 3.0.10 Minor update available for module klaro (3.0.10). klaro 3.0.9 Minor update available for module klaro (3.0.9). layout_paragraphs 2.1.2 Minor update available for module layout_paragraphs (2.1.2). geofield_map 11.1.8 Minor update available for module geofield_map (11.1.8). editoria11y 2.2.22 Minor update available for module editoria11y (2.2.22). ai 1.2.13 Minor update available for module ai (1.2.13). ai 1.3.2 Minor update available for module ai (1.3.2). moderated_content_bulk_publish 2.0.51 Minor update available for module moderated_content_bulk_publish (2.0.51). moderated_content_bulk_publish 2.0.50 Minor update available for module moderated_content_bulk_publish (2.0.50). editoria11y 2.2.21 Minor update available for module editoria11y (2.2.21). eca 3.1.0 Minor update available for module eca (3.1.0). sophron 3.1.1 Minor update available for module sophron (3.1.1). ai 1.3.1 Minor update available for module ai (1.3.1). seven 2.0.0-beta6 New beta version released for theme seven (2.0.0-beta6).

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
2
First release
Apr 2026
Latest release
13 hours ago
Release cadence
0 days
Stability
0% stable

Releases

Version Type Release date
2.x-dev Dev Apr 13, 2026
2.0.0-alpha1 Pre-release Apr 13, 2026