Jump to content

Help:Cite errors/Cite error references duplicate key

From Wikipedia, the free encyclopedia
This is an old revision of this page, as edited by PrimeHunter (talk | contribs) at 12:29, 19 October 2015 (Start help page for MediaWiki:Cite error references duplicate key). The present address (URL) is a permanent link to this revision, which may differ significantly from the current revision.
(diff) ← Previous revision | Latest revision (diff) | Newer revision → (diff)

This page will help you to fix the cite error message:

The named reference "$1" was defined multiple times with different content (see the help page).

  • If you have read this help page and find something missing or confusing, please discuss it at the main talk page.
  • Please reference this page and the page where you have the problem so we can understand your issues.
  • For basic information on the footnotes system, see Referencing for beginners; for advanced help, see Footnotes.

Overview

A footnote used multiple times may be defined with a name:

<ref name="foo">content</ref>

To invoke a named footnote:

<ref name="foo" />

The content of the ref name "foo" is only defined once.

Issues and resolution

The error happens when a named reference is defined multiple times with different content. For example, first <ref name="foo">content1</ref> and later <ref name="foo">content2</ref>, where "foo" is repeated but content1 and content2 are different. The purpose of named references is to be able to invoke them elsewhere with <ref name="foo" />, but there must be a unique definition of the ref name "foo".

If the references with content1 and content2 are meant to be different then change one of the ref names, for example name="bar" instead of name="foo". If the reference is not meant to be invoked elsewhere then it can also be made unnamed by removing name="foo", but this is not necessary.

If the references are meant to be the same then replace one of the definitions by <ref name="foo" /> to invoke the other definition. It may technically work to make two identical definitions but this should not be done. It causes confusion and will recreate the error if somebody later changes one of the definitions without making the same change to the other.

The error can also happen with empty ref names like <ref name="">content</ref>. Ref names should not be empty. Either add a name or remove name="".

Names

Names for footnotes and groups must follow these rules:

  • Names are case-sensitive. Please do not use raNdOM capitalization.
  • Names must not be purely numeric; the software will accept something like ":31337" (which is punctuation plus a number), but it will ignore "31337" (purely numeric).
  • Names should have semantic value, so that they can be more easily distinguished from each other by human editors who are looking at the wikitext. This means that ref names like "Nguyen 2010" are preferred to names like ":31337".
  • Names must be unique. You may not use the same name to define different groups or footnotes. Try to avoid picking a name that someone else is likely to choose for a new citation, such as ":0" or "NYT".
  • Please consider keeping reference names short, simple, and restricted to the standard English alphabet and numerals. If spaces are used, the following technical restrictions become relevant:
    • Quotation marks are preferred but optional if the only characters used are letters A–Z, a–z, digits 0–9, and the symbols !$%&()*,-.:;<@[]^_`{|}~. That is, all printable ASCII characters except #"'/=>?\ and space.
    • Inclusion of any other characters, including spaces, requires that the reference name be enclosed in quotes; for example, name="John Smith". But quote-enclosed reference names may not include a less-than sign (<) or a double straight quote symbol ("), which may, however, be included by escaping as &lt; and &quot; respectively.
    • The quote marks must be the standard, straight, double quotation marks ("); curly or other quotes will be parsed as part of the reference name.
  • You may optionally provide reference names even when the reference name is not required. This makes later re-use of the sourced reference easier.

Examples

References

Technical

Pages with this error message are placed into Pages with incorrect ref formatting. The system message page is at Cite error references duplicate key.