User:Zhaofeng Li/reFill

< User:Zhaofeng Li  (Redirected from Wikipedia:REFILL)

Soft redirect to:toollabs:refill
This page is a soft redirect.

<ref>{{cite web|url= |title=Example Domain|publisher=}}</ref>

reFill converts bare references (red) into more complete ones (green)

reFill (formerly Reflinks) is a tool that expands bare references semi-automatically, hosted on Toolforge. It adds information (page title, work/website, author and publication date, if metadata is included) to bare references, and does additional fixes as well (e.g. combining duplicated references). The tool is written in PHP and licensed under Simplified BSD License. The tool is an open-source replacement of Dispenser's Reflinks. The source code is available on GitHub. The templates created automatically by the tool need to be reviewed to ensure that they are accurate, as they are often not.

reFill 2Edit

Editors are invited to test reFill 2, a new version of reFill under development. It offers a redesigned interface with real-time progress reporting while the tool is running, and resolves many issues affecting the current version of the tool. Userscript and bot developers may also take advantage of the APIs exposed by reFill 2 to complete bare references programmatically.

Starting from June 30, 2019, all requests to fix English Wikipedia articles will be redirected to reFill 2. Both versions will remain available for Wikipedias in other languages.


To request reFill assistanceEdit

If there is a particular article which contains bare URLs in the references, like this one,[1] and you would like to request a Wikipedian that already has reFill installed (and is familiar with how it works) to help you fix the problem:


  1. Open the article in question in your browser
  2. Click the 'edit' button
  3. Paste the following line into the very top of the article:
            {{Cleanup-bare URLs}}
  4. Click the 'preview' button to verify that your change did not interfere with any other parts of the article
  5. Click the 'save' button

This will display a visible message (the text of which is shown at the top of Template:Cleanup-bare URLs) at the top of the Wikipedia article, and will also add the article to an 'invisible' category which requests that a Wikipedian experienced with reFill, apply it to the bare URLs in that article. It may take up to a week before someone notices your request, but if it has been several days and you have received no response, you can ask for additional assistance at the WP:TEAHOUSE.

To use reFill yourselfEdit


  • Use plain formatting instead of {{cite web}}: If selected, the tool will fill out bare references in plain CS1 format instead of {{cite web}}. All available metadata is included.
  • Do not remove link rot tags: If selected, the tool will not remove any link rot tags from the source, even if no bare references are skipped.
  • Add blank metadata fields when the information is unavailable If selected, the tool will insert blank |author= and/or |date= for filling in manually, when the corresponding metadata is unavailable.
  • Do not add access dates: If selected, access dates will be omitted from the result.
  • Use the base domain name as work when this information cannot be parsed: If selected, the base domain of the link will be used in the |website= field if the website does not supply its name in embedded metadata.

Toolbox linkEdit

Insert this code into Special:MyPage/common.js:

mw.loader.load( "" );



Frequently asked questionsEdit

Q1: Why is there an empty |publisher=?
A1: There isn't any reliable way to parse that field, and an empty one is intentionally left when |work= cannot be parsed. Please fill it in manually.
Q2: Why does reFill change various characters to "#"?
A2: The hash signs are being inserted by Internet Explorer's cross-site scripting (XSS) filter. You can disable the filter by going to  →"Internet options"→"Security"→Custom level..., scrolling to near the bottom of the list to "Enable XSS filter", and choosing "Disable". You can also work around the filter by copying everything in reFill's "New Wiki Markup" box and manually pasting it into Wikipedia or by using another web browser.

See MediaWiki Bug T34013

Q3: How can I run my own reFill instance for testing?
A3: See reFill has zero Tool Labs dependency, and can be easily installed.
Q4: Can you add support for other Wikipedias?
A4: Yes! Just add a request on the talk page.
Q5: How to find articles which can be improved using reFill?
Q6: It's not working right now! What alternatives can I use while you're fixing it?
A6: The citoid service in the visual editor provides a "Convert" button. You can also use Diberri's tool and similar scripts to generate citation templates, which you can paste into articles. You can also use reflinks This tool has the advantage of marking some (though not all) dead links with the proper template.

Reporting bugsEdit

If you have found a bug or want extra features, please post to the talk page. Alternatively, you can also create an issue on GitHub.


Having no Labs dependency, reFill can be easily installed on your own computer so that you can work on it. To contribute to reFill, create a fork on GitHub, make your changes and submit a pull request. Thank you for your contributions!

To translate the tool, please head over to

See alsoEdit

  • Userbox: {{User:UBX/reFill}}
 This user uses reFill to expand bare references.