Page MenuHomePhabricator

Sunset ShortUrl extension in favour of UrlShortener extension
Closed, ResolvedPublic

Description

NOTE: This is a proposed outcome for T187045: Code Stewardship Review: ShortUrl Extension.

Before a wiki can switch from ShortUrl to UrlShortener, the ShortUrl extension first needs to gain a feature to keep the exsiting URLs working. There are also a number of user interface improvements and transitional optoins needed during the migration.

Before and after

From T107188#11181721:

ShortUrl UI (old)UrlShortener UI (new)
Screenshot 2025-09-15 at 16.37.30.png (1,241×1,574 px, 356 KB)
Screenshot 2025-09-15 at 16.38.28.png (2,041×1,383 px, 322 KB)

List of wikis from wmf-config:

30 wikis with ShortUrl installed
'wmgUseShortUrl' => [
	'default' => false,
	'bdwikimedia' => true, // T146014
	'bhwiki' => true, // T113348
	'bnwiki' => true, // T62956
	'bnwikisource' => true, // T127968
	'eswikibooks' => true, // T96668
	'gomwiki' => true, // T206741
	'hiwiki' => true,
	'hiwikiversity' => true, // T177187
	'knwiki' => true, // T97218
	'knwikisource' => true, // T189287
	'maiwiki' => true, // T125802
	'mrwiki' => true, // T103646
	'newiki' => true, // T92820
	'orwiki' => true,
	'orwikisource' => true, // T124429
	'orwiktionary' => true, // T103644
	'pawiki' => true, // T178919
	'sawiki' => true, // T94660
	'sawikibooks' => true, // T94660
	'sawikiquote' => true, // T94660
	'sawikisource' => true, // T94660
	'sawiktionary' => true, // T94660
	'tawiki' => true,
	'tawikibooks' => true,
	'tawikinews' => true,
	'tawikiquote' => true,
	'tawikisource' => true,
	'tawiktionary' => true,
	'tcywiki' => true, // T150166
	'urwiki' => true, // T138507
],

Discovery for new short URLs.

T288653: Make URLShortener service discoverable for users

Discover short URL for current article when reading

The "ShortUrl" extension promoted the URL under the page title. This was cheap to do as the URLs were deterministic. We may not be able to do this from a performance perspective (T107188#6275214) and it may not be desirable design-wise, but we can instead expose an affordance in the sidebar toolbox.

Migration plan

Revised plan from T107188#11181721 by @Krinkle and @JTweed-WMF, based on earlier plan by @Ladsgroup and @Legoktm:

  • Develop a read-only flag for the legacy ShortUrl extension.
  • Develop a sidebar UI in the new UrlShortener extension. T267921
  • Develop simplified read-only URL resolver for ShortUrl database in UrlShortener extension repo behind a feature flag: $wgUrlShortenerLegacyTemplate. change 1275373
  • Reach out to the ~30 communities where the legacy ShortUrl extension is enabled, and advise migrating gadgets away from the class="title-shortlink" element. https://meta.wikimedia.org/wiki/Tech/News/2025/45
  • Enable wgUrlShortenerLegacyTemplate on test2wiki (which already has ShortUrl disabled, so the old dataset can be tested there).
  • Enable wgUrlShortenerLegacyTemplate on these ~30 wikis and disable the ShortUrl extension. T256993
  • Undeploy the ShortUrl extension. https://gerrit.wikimedia.org/r/1304247
  • Archive the ShortUrl extension. T429658: Archive the ShortUrl extension

Related Objects

Event Timeline

There are a very large number of changes, so older changes are hidden. Show Older Changes

One small correction on tech news, The w.wiki url shortener got deployed to production in 2019: T108557#5103986

Oops, I misread that change as enabling the local sidebar UI, because the domain appears to be live and routing to Meta-Wiki since 2016. Fixed.

Krinkle updated the task description. (Show Details)

Oops, I misread that change as enabling the local sidebar UI, because the domain appears to be live and routing to Meta-Wiki since 2016. Fixed.

Yeah, it was technically deployed but noone could shorten any url and only w.wiki/2 worked as POC.

Change #1199717 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/UrlShortener@master] Allow wgServer by default even when it includes a port

https://gerrit.wikimedia.org/r/1199717

Change #1199717 merged by jenkins-bot:

[mediawiki/extensions/UrlShortener@master] Allow wgServer by default even when it includes a port

https://gerrit.wikimedia.org/r/1199717

Change #1219892 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/UrlShortener@master] UrlShortenerUtils: Simplify validation, improve errors, improve tests

https://gerrit.wikimedia.org/r/1219892

Change #1219892 merged by jenkins-bot:

[mediawiki/extensions/UrlShortener@master] UrlShortenerUtils: Simplify validation, improve errors, improve tests

https://gerrit.wikimedia.org/r/1219892

Change #1275373 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/UrlShortener@master] Import read-only URL resolver for legacy ShortUrl table

https://gerrit.wikimedia.org/r/1275373

Change #1275373 had a related patch set uploaded (by Krinkle; author: Krinkle):

[mediawiki/extensions/UrlShortener@master] Import read-only URL resolver for legacy ShortUrl table

https://gerrit.wikimedia.org/r/1275373

Change #1275373 merged by jenkins-bot:

[mediawiki/extensions/UrlShortener@master] Import read-only URL resolver for legacy ShortUrl table

https://gerrit.wikimedia.org/r/1275373

Krinkle updated the task description. (Show Details)

Change #1290093 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/mediawiki-config@master] Enable wmgUseUrlShortenerLegacy on test2wiki

https://gerrit.wikimedia.org/r/1290093

Change #1290104 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/puppet@production] mediawiki: Disable legacy `short_urls` on vhosts where it does not work

https://gerrit.wikimedia.org/r/1290104

Change #1290093 merged by jenkins-bot:

[operations/mediawiki-config@master] Enable wmgUseUrlShortenerLegacy on test2wiki

https://gerrit.wikimedia.org/r/1290093

Mentioned in SAL (#wikimedia-operations) [2026-06-05T20:10:35Z] <krinkle@deploy1003> Started scap sync-world: Backport for [[gerrit:1290093|Enable wmgUseUrlShortenerLegacy on test2wiki (T107188)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-05T20:12:41Z] <krinkle@deploy1003> krinkle: Backport for [[gerrit:1290093|Enable wmgUseUrlShortenerLegacy on test2wiki (T107188)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Works as expected.

https://test2.wikipedia.org/s/fm
https://test2.wikipedia.org/wiki/Special:ShortUrl/fm
https://test2.wikipedia.org/wiki/Special:ShortUrl/garbage

krinkle@deploy1003$ sql testwiki
> SELECT su_id FROM shorturls WHERE su_namespace=0 AND su_title='Apple';
+-------+
| su_id |
+-------+
|   562 |
+-------+
> print base_convert(562, 10, 36);
fm

Mentioned in SAL (#wikimedia-operations) [2026-06-05T20:20:38Z] <krinkle@deploy1003> Finished scap sync-world: Backport for [[gerrit:1290093|Enable wmgUseUrlShortenerLegacy on test2wiki (T107188)]] (duration: 10m 02s)

[…] give time to migrate any custom integrations they might have. For example, Hindi Wikipedia has a gadget that replaces the "title caption" link via HTML class="title-shortlink", with a general share menu.

Default interface (legacy ShortUrl extension)Hindi Wikipedia gadget
Screenshot 2025-09-15 at 16.59.05.png (970×560 px, 105 KB)
Screenshot 2025-09-15 at 16.59.09.png (1,184×560 px, 138 KB)

Codeesearch: title-shortlink has 56 results.

I'm starting by removing gadget definitions and clearing the gadget pages for gadgets that build on the ShortUrl UI, on wikis where the ShortUrl extension isn't even installed.

There are a number of imported copies of gadgets floating around originating from a wiki that has ShortUrl installed, to a wiki that doesn't, so these gadgets don't work (I've confirmed this). The pages are often already unreferenced (i.e. mass-imported JS page, but no gadget-definition to go along with it).

40 results left. Generated using Wikimedia Global Search on 2026-06-10.

These broadly fall into these buckets:

  1. The "ShortUrl" gadget. This previously re-styled the ShortUrl UI from a line into an icon, with nothing added to it. I prepped most of these back in Oct 2025 to invoke UrlShortener when clicked. Once undeployed, these gadgets continue to work independently of ShortUrl. The display: none rule will become redundant and is safe to remove at a later time.
  2. The "ShortUrlPlus" gadget which previously re-styled the ShortUrrl UI from a line into an icon, and also added social media icons to it. I prepped most of these back in Oct 2025 to hide the ShortUrl UI (instead of augmenting it in-place) and independently create a similar element in its place. Once ShortUrl is undeployed, these will keep working the same way as today. The display: none rule will become redundant and is safe to remove at a later time.
  3. Wikis with the "IndicTechComShortUrl.js" already hide the legacy ShortUrl UI today in Common.css (e.g. gom.wikipedia.org). This is a modern gadget with a OOUI-like button and calls the new UrlShortener API and copies it to the clipboard and announces it via mw.notify. Will continue to work fine. The display: none rule in Common.css will become redundant and is safe to remove at a later time.
  4. Gadgets that are not ready. These typically rely on $("li#t-shorturl").children().attr("href") which would stop working. Should be migrated to something like the "Ready" version of the "ShortUrl" gadget, possibly unconditional instead of conditional. A simple "Share" button that when clicked opens the UrlShortener modal would be nice to keep here. Some of these are reasonably close to a nice click-to-share button already, e.g. feeding the clipboard and calling mw.notify. Otheres display the shortened URL in plain text and need a bit more work (no direct replacement).
WikiResultsComment
bd.wikimediaমিডিয়াউইকি:Gadget-ShortUrl.css, মিডিয়াউইকি:Gadget-ShortUrl.jsReady.
bh.wikipediaमीडियाविकि:Gadget-ShortUrlPlus.cssReady.
bn.wikipediaমিডিয়াউইকি:Gadget-ShortUrl.cssReady.
bn.wikipediaমিডিয়াউইকি:Gadget-ShortUrl.jsReady.
bn.wikisourceমিডিয়াউইকি:Gadget-ShortUrl.jsReady.
bn.wikisourceমিডিয়াউইকি:Gadget-ShortUrl.cssReady.
es.wikibooksMediaWiki:Common.cssReady.
gom.wikipediaमिडियाविकी:Gadget-ShortUrl.jsReady.
gom.wikipediaमिडियाविकी:Gadget-ShortUrl.cssReady.
gom.wikipediaमिडियाविकी:Common.cssReady.
hi.wikipediaमीडियाविकि:Common.cssNOT READY
hi.wikipediaमीडियाविकि:Gadget-ShortUrl.jsNOT READY
hi.wikipediaमीडियाविकि:Gadget-ShortUrl.cssNOT READY
hi.wikipediaमीडियाविकि:Gadget-ShortUrlShare.jsNOT READY
hi.wikipediaमीडियाविकि:Gadget-ShortUrlShare.cssNOT READY
hi.wikiversityमीडियाविकि:Gadget-ShortUrl.jsNOT READY
hi.wikiversityमीडियाविकि:Gadget-ShortUrl.cssNOT READY
hi.wikiversityमीडियाविकि:Gadget-ShortUrlShare.jsNOT READY
hi.wikiversityमीडियाविकि:Gadget-ShortUrlShare.cssNOT READY
mai.wikipediaमेडियाविकि:Gadget-ShortUrl.jsNOT READY
mai.wikipediaमेडियाविकि:Gadget-ShortUrl.cssNOT READY
mr.wikisourceमिडियाविकी:Gadget-ShortUrl.jsReady. (Looks unready, but no-op because ShortUrl was never installed here!)
mr.wikisourceमिडियाविकी:Gadget-ShortUrl.cssReady. (Looks unready, but no-op because ShortUrl was never installed here!)
ne.wikipediaमीडियाविकि:Gadget-ShortUrl.jsNOT READY
ne.wikipediaमीडियाविकि:Gadget-ShortUrl.cssNOT READY
ne.wikipediaमीडियाविकि:Gadget-ShortUrlShare.jsNOT READY
ne.wikipediaमीडियाविकि:Gadget-ShortUrlShare.cssNOT READY
or.wikipediaମିଡ଼ିଆଉଇକି:Gadget-ShortUrl.jsNOT READY
or.wikipediaମିଡ଼ିଆଉଇକି:Gadget-ShortUrl.cssNOT READY
pa.wikipediaਮੀਡੀਆਵਿਕੀ:Gadget-ShortUrl.cssNOT READY
pa.wikisourceਮੀਡੀਆਵਿਕੀ:Gadget-ShortUrl.jsNOT READY
pa.wikisourceਮੀਡੀਆਵਿਕੀ:Gadget-ShortUrl.cssNOT READY
sa.wikipediaमीडियाविकि:Gadget-ShortUrl.jsNOT READY
sa.wikipediaमीडियाविकि:ShortUrl.cssNOT READY
sa.wikipediaमीडियाविकि:Gadget-ShortUrl.cssNOT READY
sa.wiktionaryमीडियाविकि:Gadget-ShortUrl.jsNOT READY
sa.wiktionaryमीडियाविकि:Gadget-ShortUrl.cssNOT READY
ur.wikipediaمیڈیاویکی:Gadget-ShortUrl.jsNOT READY
ur.wikipediaمیڈیاویکی:Gadget-ShortUrl.cssNOT READY

Tomorrow, I'll undeploy ShortUrl on the wikis that have no relevant gadgets or where its gadgets are ready.

Change #1300154 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/mediawiki-config@master] Disable ShortUrl extension on bdwikimedia, bhwiki, bnwiki, eswikibooks

https://gerrit.wikimedia.org/r/1300154

Change #1300154 merged by jenkins-bot:

[operations/mediawiki-config@master] Disable ShortUrl on bdwikimedia, bhwiki, bnwiki, bnwikisource, eswikibooks, gomwiki

https://gerrit.wikimedia.org/r/1300154

Mentioned in SAL (#wikimedia-operations) [2026-06-10T23:04:02Z] <krinkle@deploy1003> Started scap sync-world: Backport for [[gerrit:1300154|Disable ShortUrl on bdwikimedia, bhwiki, bnwiki, bnwikisource, eswikibooks, gomwiki (T107188)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-10T23:06:11Z] <krinkle@deploy1003> krinkle: Backport for [[gerrit:1300154|Disable ShortUrl on bdwikimedia, bhwiki, bnwiki, bnwikisource, eswikibooks, gomwiki (T107188)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Confirmed on https://bd.wikimedia.org/. title-shortlink-container which was previously hidden by CSS is now no longer in the DOM. The gadget still works fine. The link https://bd.wikimedia.org/s/9x still works fine, and indeed is served by the new read-only router in the UrlShortener extension per https://performance.wikimedia.org/excimer/profile/ba2b86d53ca7656c, showing a response from MediaWiki\Extension\UrlShortener\SpecialLegacyShortUrl::execute.

Mentioned in SAL (#wikimedia-operations) [2026-06-10T23:15:40Z] <krinkle@deploy1003> Finished scap sync-world: Backport for [[gerrit:1300154|Disable ShortUrl on bdwikimedia, bhwiki, bnwiki, bnwikisource, eswikibooks, gomwiki (T107188)]] (duration: 11m 37s)

Change #1302274 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/mediawiki-config@master] Disable ShortUrl on hiwiki, hiwikiversity

https://gerrit.wikimedia.org/r/1302274

Krinkle updated the task description. (Show Details)

Change #1302274 merged by jenkins-bot:

[operations/mediawiki-config@master] Disable ShortUrl on hiwiki, hiwikiversity, maiwiki, knwiki, knwikisource, tcywiki

https://gerrit.wikimedia.org/r/1302274

Mentioned in SAL (#wikimedia-operations) [2026-06-16T18:48:46Z] <krinkle@deploy1003> Started scap sync-world: Backport for [[gerrit:1302274|Disable ShortUrl on hiwiki, hiwikiversity, maiwiki, knwiki, knwikisource, tcywiki (T107188)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-16T18:51:07Z] <krinkle@deploy1003> krinkle: Backport for [[gerrit:1302274|Disable ShortUrl on hiwiki, hiwikiversity, maiwiki, knwiki, knwikisource, tcywiki (T107188)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-16T19:00:04Z] <krinkle@deploy1003> Finished scap sync-world: Backport for [[gerrit:1302274|Disable ShortUrl on hiwiki, hiwikiversity, maiwiki, knwiki, knwikisource, tcywiki (T107188)]] (duration: 11m 18s)

Change #1303006 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/mediawiki-config@master] Disable ShortUrl on mrwiki, newiki, pawiki, tawiki

https://gerrit.wikimedia.org/r/1303006

Change #1304247 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/mediawiki-config@master] Undeploy the ShortUrl extension

https://gerrit.wikimedia.org/r/1304247

Change #1303006 merged by jenkins-bot:

[operations/mediawiki-config@master] Disable ShortUrl on remaining wikis

https://gerrit.wikimedia.org/r/1303006

Mentioned in SAL (#wikimedia-operations) [2026-06-19T18:01:25Z] <krinkle@deploy1003> Started scap sync-world: Backport for [[gerrit:1303006|Disable ShortUrl on remaining wikis (T107188)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-19T18:03:36Z] <krinkle@deploy1003> krinkle: Backport for [[gerrit:1303006|Disable ShortUrl on remaining wikis (T107188)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Mentioned in SAL (#wikimedia-operations) [2026-06-19T19:21:39Z] <krinkle@deploy1003> Finished scap sync-world: Backport for [[gerrit:1303006|Disable ShortUrl on remaining wikis (T107188)]] (duration: 80m 14s)

Change #1304247 merged by jenkins-bot:

[operations/mediawiki-config@master] Undeploy the ShortUrl extension

https://gerrit.wikimedia.org/r/1304247

Mentioned in SAL (#wikimedia-operations) [2026-06-26T13:14:43Z] <krinkle@deploy1003> Started scap sync-world: Backport for [[gerrit:1304247|Undeploy the ShortUrl extension (T107188)]], [[gerrit:1305804|extension-list: Remove WikimediaApiPortalOAuth ext and WikimediaApiPortal skin (T429373 T429374 T418494)]]

Mentioned in SAL (#wikimedia-operations) [2026-06-26T13:32:41Z] <krinkle@deploy1003> krinkle: Backport for [[gerrit:1304247|Undeploy the ShortUrl extension (T107188)]], [[gerrit:1305804|extension-list: Remove WikimediaApiPortalOAuth ext and WikimediaApiPortal skin (T429373 T429374 T418494)]] synced to the testservers (see https://wikitech.wikimedia.org/wiki/Mwdebug). Changes can now be verified there.

Krinkle removed a project: Patch-For-Review.
Krinkle updated the task description. (Show Details)

Mentioned in SAL (#wikimedia-operations) [2026-06-26T13:59:18Z] <krinkle@deploy1003> Finished scap sync-world: Backport for [[gerrit:1304247|Undeploy the ShortUrl extension (T107188)]], [[gerrit:1305804|extension-list: Remove WikimediaApiPortalOAuth ext and WikimediaApiPortal skin (T429373 T429374 T418494)]] (duration: 44m 35s)

Change #1290104 merged by Ladsgroup:

[operations/puppet@production] mediawiki: Disable legacy `short_urls` on vhosts where it does not work

https://gerrit.wikimedia.org/r/1290104

Change #1321603 had a related patch set uploaded (by Krinkle; author: Krinkle):

[operations/puppet@production] mediawiki: Disable legacy `short_urls` on vhosts where it does not work (take 2)

https://gerrit.wikimedia.org/r/1321603

Change #1321603 merged by Ladsgroup:

[operations/puppet@production] mediawiki: Disable legacy `short_urls` on vhosts where it does not work (take 2)

https://gerrit.wikimedia.org/r/1321603

Mentioned in SAL (#wikimedia-operations) [2026-08-06T18:17:04Z] <ladsgroup@deploy1003> Started scap sync-world: Deploying gerrit:1321603 (T107188)

A lot of:

...
      
          # Math compatibility mode
          RewriteCond %{ENV:RW_PROTO} !=""
          RewriteRule ^/math/(.*) %{ENV:RW_PROTO}://upload.wikimedia.org/math/$1 [R=301]
          RewriteRule ^/math/(.*) https://upload.wikimedia.org/math/$1 [R=301]
-         # ShortUrl support, for wikis where it's enabled
-         RewriteRule ^/s/.*$     /w/index.php
      
          # Forbid accessing files under /w/extensions
          RewriteRule ^/w/extensions/.*\.php - [F,L]
          <FilesMatch "\.php$">
              SetHandler "proxy:unix:/run/shared/fpm-www.sock|fcgi://localhost"
...

Mentioned in SAL (#wikimedia-operations) [2026-08-06T18:19:46Z] <ladsgroup@deploy1003> Started scap sync-world: Deploying gerrit:1321603 (T107188)

Mentioned in SAL (#wikimedia-operations) [2026-08-06T18:25:27Z] <ladsgroup@deploy1003> Finished scap sync-world: Deploying gerrit:1321603 (T107188) (duration: 06m 08s)

I deployed this and the site is up and https://www.wikifunctions.org/s/blabla no longer works \o/

I deployed this and the site is up and https://www.wikifunctions.org/s/blabla no longer works \o/

🎉