User:Eejit43/scripts/redirect-helper

☆ Save On Wikipedia ↗
User script
redirect-helper
DescriptionUser script to easily manage redirects
AuthorEejit43
First releasedMay 17, 2023 (2023-05-17)
UpdatedJune 22, 2026 (2026-06-22)
BrowsersTested on Chromium and Firefox
Skins
SourceUser:Eejit43/scripts/redirect-helper.js
GitHub repositoryredirect-helper

This user script enables convenient editing and creation of redirects. Although it serves a similar purpose to Wugapodes' "Capricorn" and its earlier versions, this script is completely different. It has been redesigned with enhanced user-friendliness and incorporates new features.

Usage

This script's editor can be accessed in the following ways:

  • Using the automatically set up dialog on redirect pages
  • Can be started when clicking "Create redirect" on a nonexistent page
  • Can be started by clicking "Redirect page" in the "More"/"Tools" menu on an existing article
  • Can be started in a new page after inputting a title in the "Redirect page here" dialog opened in the "More"/"Tools" menu on an existing non-redirect page.

Configuration

This script can be configured via a window.redirectHelperConfig object to your common.js. This takes the following form:

window.redirectHelperConfiguration = {
    createdWatchMethod: 'nochange' | 'preferences' | 'unwatch' | 'watch',
    patrolByDefault: true | false,
};

By default, redirects that are created will use the preferences watchlist change method, following the Preferences Watchlist Watched pages Tick Add pages and files I edit to my watchlist configuration field. This can be changed by setting createdWatchMethod to either nochange (don't change watch settings for the created page), unwatch (unwatch the created page), or watch (watch the created page).

By default, redirects that are edited that are patrollable will be patrolled by default. This can be changed by setting patrolByDefault to false.

Both of the configurable options can also be overridden on a per-page basis using checkboxes in the on-screen modal.

Example

For example, to not change watch settings for created pages and to not patrol pages by default, add the following to your common.js:

window.redirectHelperConfiguration = {
    createdWatchMethod: 'nochange',
    patrolByDefault: false,
};

Recent notable changes

For a more detailed changelog, see the script's GitHub commit history.

  • June 22, 2026 (2026-06-22): Fix handling of nonexistent targets.
  • May 18, 2026 (2026-05-18):
    • Remove usage of unnecessary API calls on every page load.
    • Add new "Redirect page here" button.
  • May 14, 2026 (2026-05-14): Hide nonfunctional categorization section on non-enwiki projects.
  • May 3, 2026 (2026-05-03): Add patrolByDefault option to control default patrolling behavior.
  • June 10, 2025 (2025-06-10): Support syncing subpage talk page redirects with their root talk page.
  • March 10, 2025 (2025-03-10): Support adding sort keys to categories.
  • December 22, 2024 (2024-12-22): Support the modification of created pages' watchlist status via config option and UI checkbox.
  • December 12, 2024 (2024-12-12):
    • Support internationalization of "#REDIRECT" text
    • Make edit summary link correct across projects.
  • December 4, 2024 (2024-12-04): Support creating and editing redirects while editing pages.
  • September 12, 2024 (2024-09-12): Fix falsely marking target as changed when only the first letter capitalization was fixed.
  • September 4, 2024 (2024-09-04): Suggest DEFAULTSORTs for redirects tagged with {{R from band member}}.
  • September 3, 2024 (2024-09-03): Suggest DEFAULTSORTs for more redirects.
  • August 29, 2024 (2024-08-29): Correctly handle unnamed template parameters without preceding parameters.
  • August 26, 2024 (2024-08-26): Preserve usage of {{Authority control}}.
  • July 15, 2024 (2024-07-15): Add very basic dark mode support.
  • May 16, 2024 (2024-05-16): Prevent all redirect rcat templates from showing up when searching "with possibilities".
  • April 19, 2024 (2024-04-19): Add more informative ("add"/"removed" alongside "changed") edit summaries.
  • April 18, 2024 (2024-04-18): Support redirects to television episode anchors.
  • April 17, 2024 (2024-04-17):
    • Support the addition of rcat redirects with possibilities.
    • Implement auto-fix feature for certain warnings.
  • March 20, 2024 (2024-03-20): Add check for missing required tag parameters.
  • March 19, 2024 (2024-03-19):
    • Move preview button to submit section, preview all information instead of just templates.
    • Support editing redirect categorization template arguments for templates that have TemplateData.
  • March 4, 2024 (2024-03-04): Add button to suggest DEFAULTSORTs in certain situations.
  • February 8, 2024 (2024-02-08): Handle redirects to surname lists.
  • February 7, 2024 (2024-02-07): Fix redirects to categories adding category instead of linking to it.
  • January 30, 2024 (2024-01-30): Ignore italic text in section names for redirect target.
  • January 29, 2024 (2024-01-29):
    • Add a check for {{R with Wikidata item}} without being linked to a Wikidata item and vice versa.
    • Add "Show changes" button to show the diff of the current changes to the redirect.
    • Move the preview templates button to a layout with the tag input element.
  • January 28, 2024 (2024-01-28): Add a field for modifying redirect default sort key (DEFAULTSORT).
  • January 27, 2024 (2024-01-27): Add a field for modifying redirect categories.
  • January 26, 2024 (2024-01-26):
    • Change background color to gray and switch styles to be applied through classes/ids so they can be customizable.
    • Add support for viewing categories in "Preview templates" menu.
  • January 25, 2024 (2024-01-25): Add "Preview templates" button to show how the selected redirect categorization templates would appear on the current page.
  • January 24, 2024 (2024-01-24): Add checks for using protection redirect categorization templates unnecessarily.

Installation

Simple

Install Enterprisey's "script-installer" (at Preferences Gadgets Advanced Tick Install scripts without having to manually edit JavaScript files (documentation)), then come back to this page and click the "Install" button in the infobox on the right.

Manual

Add the following to your common.js (or a skin specific JavaScript page):

{{subst:install user script|User:Eejit43/scripts/redirect-helper.js}}

Global and other wiki installation

To install this user script globally, across all Wikimedia projects, add the following to your global.js on Meta-Wiki. See meta:Global user pages for more information.

This same method can be used to install the script on projects outside of the English Wikipedia, or even on MediaWiki wikis outside of Wikimedia.

mw.loader.load('//en.wikipedia.org/w/index.php?title=User:Eejit43/scripts/redirect-helper.js&action=raw&ctype=text/javascript'); // Backlink: [[w:en:User:Eejit43/scripts/redirect-helper.js]]

Note: if you install this script here and globally, it will be double-loaded. Add a check in your global.js to prevent this from happening as seen in this permalink, or simply only install the script in one location.

Comments/bug reports

Please leave comments or report bugs on my talk page, or file an issue on the GitHub repository.