Wikipedia:User scripts

  (Redirected from Wikipedia:US)

User scripts are programs written in JavaScript for use on Wikipedia by users. User scripts enable your user account to do many things that they otherwise couldn't. Many user scripts are available ready for you to install. Users may also write new user scripts, starting with an existing user script and modifying it, or starting from scratch.

The JavaScript WikiProject is the collaboration of editors to improve Wikipedia's JavaScript coverage, write user scripts, and maintain user script-related pages (like the one you are reading right now). If you would like to join, sign up here.

A word about securityEdit

User scripts have unlimited access to your account by their very nature – unlike Huggle, where you can control access levels, the script runs in your browser. Anything you can do, it can do. However, unlike a standard userspace template, you don't need to worry about vandalism – JavaScript code in user space is protected from other users. Only interface administrators and the user in whose space the script lies can edit it. As such, and this is especially pertinent to users with advanced permissions, make sure that you trust the user who wrote the script, as you will be held responsible for any actions it takes on your behalf. If you are "importing" a script (instead of copying the code itself) be warned that the user you are importing from could alter their script at any time. Only import from users you trust.

List of user scriptsEdit

If you come across or write a user script, please add it to Wikipedia:User scripts/List.

Don't see what you need? You can make a request for a new user script at Wikipedia:User scripts/Requests.

Using scripts: Frequently asked questionsEdit

Where can I find user scripts?Edit

Try these pages:

How do you install user scripts?Edit

Select one that you want from Wikipedia:User scripts/List. Either click on the superscript link (if there is one) and follow the instructions in the footnote, or follow the link with the script's name to read the documentation and find out how to install it. Normally you need to paste some code into your common.js page. After you do that, publish your common.js and follow the instructions at the top of your new common.js (the part about bypassing your browser's cache). You should now be able to use the script.

Step-by-step instructionsEdit

  1. First, make sure you are registered and logged in. Only logged-in users can install user scripts.
  2. Click here to edit your common.js file.
  3. Add the following line: {{subst:Lusc|script_path}} – replace "script_path" with the full name of the .js page that opens when a script's "(source)" link is clicked.
    • For example, to install the Sharebox script, add the following line: {{subst:Lusc|User:TheDJ/sharebox.js}}
  4. To help with usage statistics, add a backlink at the end of the line: // [[script_path]]
    • Like this: {{subst:Lusc|User:TheDJ/sharebox.js}} // [[User:TheDJ/sharebox.js]]
  5. Save the page and bypass your cache to make sure the changes take effect.

Automatic installerEdit

Script Installer makes script installations fully automatic. The installer itself must first be enabled in the Gadgets section of Preferences. Afterwards, most scripts can be installed with a single click.

Remote scriptsEdit

  1. First, make sure you are registered and logged in. Only logged-in users can install scripts.
  2. Edit your common.js file. Alternatively, you may use your skin.js to work only your current skin.
  3. Add the following line: mw.loader.load( '//' );
    — where "script_path" is the full name of the .js page that opens when a script's "(source)" link is clicked.
    • For example, to install the NoEditSummary script, add the following line:
      mw.loader.load( '//' );
  4. Save the page and bypass your cache to make sure the changes take effect.

How do you add new scripts to the scripts list?Edit

Use {{userscript}}. Include at least a code page address. Add a short description after the userscript template. For example:

*{{userscript | name= My script | code= User:Me/MyJSpage.js | doc= User:Me/MyJSdocumentationPage }} – This script does something useful.
  • Name defaults to the code page's name, without its path or ".js".
  • If a documentation page exists matching your .js page name, it will be linked automatically, without the need for a doc parameter.

Writing user scriptsEdit

Instructions for writing your own user scripts are included in Wikipedia:User scripts/Guide.

Additional script-writing resources are presented below.


The following code snippets still exist under the now defunct WikiProject User scripts. Many are still in use by live scripts, and they may provide insights for current script developers.


CSS code in this section is added slightly differently to JavaScript code. The code can be imported by adding {{subst:css|Page_name}} to your monobook.js, or the code can be @imported into your monobook.css. You can just paste the source code if you do not wish to receive updates to the code when it is improved.

Name and link Purpose Compatible skins
externals Replaces the external link icon with the corresponding favicon (works for some links) Chick, Monobook, Myskin, and Simple
VectorButtons Give those boring gray standard buttons a Vector-like appearance All
accesskey Display corresponding access keys besides links.
RetroLogo Replace the top-left Wikipedia logo.


Want to advertise your user script development skills?

Markup Renders as
{{user script developer}}
 This user develops
user scripts;
{{user script developer2}}
 This user develops user scripts.
{{user scripts created}}
 This user has created a user script;
{{user scripts created|99}}
 This user has created 99 user scripts;

See alsoEdit