| This essay contains the advice or opinions of one or more Wikipedia users. Essays may represent common ideas, or ideas that many users would not support. They are not rules. Think carefully about what they say before following them. |
| This page in a nutshell: This page is a guide on how to fix issues in broken references. |
This essay will talk about the issues that cause and the ways to correct the problem of Broken References. Care should be taken when making changes to pages. Editors should always preview changes before pressing "Publish page" to make certain they are creating as little work for others to clean up as possible.
References are a very important part of Wikipedia. They allow the users and other editors to verify the information in an article. Because of this, care needs to be taken that the references are handled correctly. A major issue with this is broken references. This is caused when a reference is called by name but that name is not defined in the article. For example <ref name="NYTimes"/> is used to call on the reference named NYTimes and to use the text entered for it. ie. <ref name="NYTimes">{{cite web|url=... ...}}</ref> The problem is caused when the second part, which defines the reference is not found. This error is noted in the Reference section of the article and the article is place into a maintenance category so the issue can be easily located. A second common form of broken reference is when the same name is used with different text in each usage. The last cause of errors in this area are missing reference or note lists. These are caused when a reference is used but there is no call for the references or notes to be displayed.
No matter which actual error is in the article, an article with broken references is added to Category:Pages with reference errors.
For the basis of this essay, two forms of references are used.
When a reference is called but not defined, an error message is created in the reference section and the article is place in a maintenance category.
The error message is similar to:
1. Cite error: The named reference NYTimes was used but no text was provided for refs named (see the help page).
This tells the editor that somewhere in that article there is a reference tag calling for the reference named NYTimes but that name has not been defined. By finding the refence number ([1] in this case) the editor can find where the problem is located. There are generally two causes for this. The first is that the reference name was mistyped. (MYTimes instead of NYTimes for example). This is a simple error and easy to just correct the name. The second cause is more common and not as easy to deal with. Often times, when an editor is importing information from another language Wikipedia, they will copy the information they need and paste it here. This is very common with {{infobox}} templates. It is common on the English Wikipedia to put the references that define a name in the body of the article and put those that call them in the infobox. If this is the case, the person adding the information will likely not have all of the references that are called for.
To correct this issue, the editor need to follow a few simple steps for each broken reference.
When fixed, the reference section should look similar to this:
==References==
{{reflist| refs=
<ref name="NYTimes">Some reference</ref>
<ref name="MSB">{{cite web|url=... ...}}</ref>
}}
This would let the editor call two listed references anywhere in the article. The layout of this section does not matter. It is usually best to keep it simple with each reference separated from the others to make them easier to work with. Extra whitespace has no effect here. This fix may lead to a different problem. If a reference defined in the reference section is not used in the article, a separate warning is given:
Cite error: Cite error: <ref> tag with name "MSB" defined in <references> is not used in prior text. ().
This is fixed by simply removing that reference from the reference section if it is truly not needed and not just a mistyped name.
If the problem is a missing note, the process is the same but the reference will likely be an {{efn}} template and will need to be added to the notes section:
==Notes==
{{notelist| refs=
{{efn|name=NYT|Some note information}}
}}
A second problem that can cause broken redirects is when two references try to define the same name but have different text. It is best to only define a reference one time in an article and call that reference each time it is needed. This is not always how editors do it. Some people include the full definition each time they use a reference and do not call back to it. While the system will still group the references together, it can lead to other problems. One problem is caused by archive bots fixing dead references and another is caused by editor. This is mostly an issue with new and inexperienced editor. Both problems cause the same error:
<ref name="NYTimes">some text</ref><ref name="NYTimes">some other text</ref>
1. 1.0, 1.1 Cite error: Invalid <ref> tag; name "NYTimes" defined multiple times with different content
Archive bots are part of the problem with this error. The bots are not the sole problem as it requires the editor to define a reference more than one time for the bot to cause this. If an archive bot makes an edit to fix a dead link and redirect the reference to an archived version of that reference, the bot only changes the first instance of the definition. If the reference is defined more than one time, this causes more than one version of text for that name. To repair this, all but the reference the bot fixed needs to be looked at. Each tag, other than the definition, needs to point back to the definition.
Editors can cause this problem as well. Actually, editors are likely the main cause since are the basis for the bot problem above. There are mainly two problems caused by editor. Both involve defining a reference more than one time. Doing this does not break the references by itself but this practice allows for other ways to cause errors. The first is simple and common - Typo. While it is often easiest to fix just by correcting the typo, it is best to remove all but one definition and have the other references call back to it.
More troublesome and much harder to deal with is when the editor uses the same name for many references. This is most often seen with new editor such as school projects. The editor will define the reference every time they use one but always name the reference the same name {for example name=":0"). If they define each ref, this can be fixed by just renaming them all separately based on how they are defined. Keep one definition and point all the others back to it. The biggest problem here is when they combine the two; define a name multiple time and refer back to those definitions later in the article. Often times, without studying each reference, only the person who put the references in knows which reference definition they meant to point to. While not a common problem, this one requires the most work to fix.
The simplest problem with broken references is when they are not being displayed. By default, the system will show the general references used in an article at the end of the page. A reference tag is not strictly needed but not using one is usually not acceptable.
If notes are used on the page, a separate list must be set up to display them. If no note section is found on the page, the following error is displayed:
Cite error: There are <ref group=lower-alpha> tags or {{efn}} templates on this page, but the references will not show without a {{reflist|group=lower-alpha}} template or {{tl}notelist}} template (see the help page).
In either case, the needed section and list template needs to be added to the page.
==Notes==
{{notelist}}
==References==
{{reflist}}