Wikipedia:Dealing with 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.

1. Definition
<ref name="TARGET"> Some information </ref>
This reference defines the name TARGET. Any time another reference calls back to, this information is given. In the reference section, this reference and all those that refer back to it will be grouped under the same number. Each use will be further linked in the reference list with a superscripted number as well. (1.0, 1.1, 1.2) This lets the reader go to each instance directly.
2. Call back
<ref name="TARGET"/>
A reference "calls back" when tells the software that it is the same as a reference which has already been defined. The reference does this by identifying itself with the name which was defined. Rather than add the definition each time, all references with a the same name have the same information and are all grouped together. These references do not have any information in them of their own and do not use the <.ref> tag to close the reference.
  • TARGET - This is the name for the reference. The name can be anything, but it is usually best if the name is similar to the reference. For example, the website or the name of the author of the book where the reference can be found. This makes it easier to remember which name is used for which reference. A name should only be defined time in an article. Each name should be unique and descriptive of the reference. The name does not have to be in quotation marks unless more than one word is used in the name but it is very common to always use quotation marks. While quotation marks do not matter much, case is important. "TARGET" and TARGET are seen as the same but TARGET, Target and "target" are not.

No Text

change

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.

  1. Copy the name of the reference being called. In the above text that is NYTimes.
  2. Open the source the information was taken from. This is often the article on the English Wikipedia. This is best done in a separate browser tab or window.
  3. Go to the section that lets you edit the article (Change/Edit page)
  4. Search for the needed reference. If using Google Chrome, press Ctrl+f and paste the name in the search block to make it easier to find. Others browsers should have similar functions.
  5. There should be two types of references with the name that is being looked for: calls and defining. The search can be refined by adding ">" after the name to just look for that tag. Calling tags would use "NYTimes"/> and defining are "NYTimes">. Note that quotes are not always used so NYTimes> may be the name being searched for.
  6. Copy the entire reference. It begins with the reference tag and ends with the </ref> tag.
  7. On the article being worked on here, go to the reference section. Hopefully the section is using the {{reflist}} tag. If it is using <references/>, replace it with the Reflist template.
  8. Change the Reflist tag to add the |refs= parameter. Any reference added here can be used anywhere else in the article.
  • Repeat as needed until all needed references are copied over and all error messages are cleared.

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}}

}}

Different text

change

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

change

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.

Missing lists

change

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}}