User:Eejit43/scripts/article-cleaner

This user script adds the ability to fix stylistic and other miscellaneous issues in articles, of which a list can be found below.

User:Eejit43/scripts/article-cleaner
User script
article-cleaner
DescriptionUser script to fix stylistic and other minor issues in articles
AuthorEejit43
First releasedFebruary 10, 2025; 18 months ago (2025-02-10)
UpdatedAugust 3, 2026; 23 days ago (2026-08-03)
BrowsersTested on Chromium and Firefox
Skins
SourceUser:Eejit43/scripts/article-cleaner.js
GitHub repositoryarticle-cleaner.ts

This user script adds the ability to fix stylistic and other miscellaneous issues in articles, of which a list can be found below.

This script can possibly make unexpected changes, please make sure you check the diff before submitting edits.

Features

  • Cleans up section headers (fixes capitalization, depth, and spacing)
  • Removes improper or unnecessary magic words
  • Cleans up DISPLAYTITLEs/DEFAULTSORTs (converts templates magic words and removes unnecessary magic words)
  • Cleans up categories (fixes category links or transclusions)
  • Cleans up links (cleans up spacing, optimizes text after links instead of piping, moves punctuation out of alt text, and more)
  • Removes improper characters (replaces smart quotes and ellipses with their standard counterparts, and replaces non-breaking spaces with their HTML tag for readability)
  • Cleans up improper date ranges
  • Removes stray markup (removes empty tags and toolbar markup filler text)
  • Cleans up spacing (removes many types of excess spacing and adds extra spacing where needed)
  • Cleans up references (fixes links in ref tags, corrects spacing, makes tags self-closing, and more)
  • Cleans up templates (resolves certain aliases, aligns parameters in infoboxes and other templates, removes unnecessary templates, and more)
  • Removes unnecessary comments (comments left over from article drafts, etc.)
  • Automatically adds/removes {{Uncategorized}}/{{Improve categories}}

Usage

This script is be activated using a link in the "More"/"Tools" menu, visible when in editing mode on a page. On mobile, this script is instead activated by a new button in the editing toolbar.

Recent notable changes

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

  • August 3, 2026; 23 days ago (2026-08-03): Fix activation button not showing on Vector legacy (2010).
  • July 9, 2026; 48 days ago (2026-07-09): Fix space removal inside timeline tags.
  • June 25, 2025; 14 months ago (2025-06-25):
    • Move bold/italic markup outside of link alt text.
    • Prevent modifying leading spacing inside poem/pre/templatedata tags.
  • June 24, 2025; 14 months ago (2025-06-24): Add support for mobile editing.
  • June 16, 2025; 14 months ago (2025-06-16): Automatically resolve certain template aliases.
  • June 14, 2025; 14 months ago (2025-06-14):
  • May 25, 2025; 15 months ago (2025-05-25): Strip weird invisible Unicode characters from article content.
  • May 9, 2025; 15 months ago (2025-05-09):
    • Strip unneeded namespace prefix from and prettify template calls.
    • Automatically substitute {{PAGENAME}} and other magic words.
  • May 8, 2025; 15 months ago (2025-05-08): Strip unnecessary template parameters when formatting.

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/article-cleaner.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/article-cleaner.js&action=raw&ctype=text/javascript'); // Backlink: [[w:en:User:Eejit43/scripts/article-cleaner.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.

Content Disclaimer

Informasi ini disarikan dari Wikipedia dan disajikan kembali untuk tujuan edukasi. Konten tersedia di bawah lisensi CC BY-SA 3.0. Kami tidak bertanggung jawab atas ketidakakuratan data yang bersumber dari kontribusi publik tersebut.

  1. The information displayed on this website is sourced in part or in whole from Wikipedia and has been adapted for the purpose of restating it. We strive to provide accurate and relevant information, however:
  2. There is no guarantee of absolute accuracy. Wikipedia is an open, collaborative project that can be edited by anyone, so information is subject to change.
  3. It is not intended to constitute professional advice. The content displayed is for informational and educational purposes only. For important decisions (e.g., medical, legal, or financial), please consult a professional.
  4. Content copyright. Wikipedia is licensed under the Creative Commons Attribution-ShareAlike License (CC BY-SA). This means that content may be reused with appropriate attribution and shared under a similar license.
  5. Responsible use. Any risk arising from the use of information from this website is entirely the responsibility of the user.