Template:Dead link
{{#switch:¬
|¬= |SUBST=
}}{{#if:|{{#ifeq:{{{name}}}|Dead link||{{#if:||}}}}}}{{#if:
|[{{#if:
|{{{pre-text}}}
}}{{#if:
| {{{post-text}}}
}}]|[{{#if: |dead link|{{#if:|permanent dead link|dead link}}}}]
}}
{{#ifeq:dead link |doc
|
{{#ifeq:show |show
|| icon | This is a documentation subpage for Template:Terminate sentence It may contain usage information, categories and other content that is not part of the original {{#if: |{{{text2}}} |{{#if: |{{{text1}}} |{{#ifeq:Template |User |template template page |{{#if:Template |template page|article}}}}}}}}. |
}}{{#if:|
|{{#ifexist:Template:Dead link
| [[Category:{{#switch:Template |Template=Template |Module=Module |User=User |#default=Wikipedia}} documentation pages]]
|
}}
}}
|
}}
| Warning | This template is used on approximately 366,000 pages. To avoid major disruption and server load, any changes should be tested in the template's /sandbox or /testcases subpages, or in your own user subpage. The tested changes can be added to this page in a single edit. Consider discussing changes on the talk page before implementing them. |
This template is used to mark dead links, either within a paragraph or within a reference citation. Marking dead links signals to editors and to WP:Link rot bots that this link needs to be replaced with an archive link. Sometimes dead links can be repaired manually; see Link rot for suggestions.
Usage
Before considering whether to use the {{dead link}} template it is often useful to make a search for an archive copy of the dead link, or find the new URL of a moved link or an alternative source using methods from WP:DEADLINK, and thereby avoid using the tag altogether. All <{{#if:|code|span}}>{{cite xxx{{#if:||{{{1}}}}}}}</{{#if:|code|span}}> templates have the facility for adding |{{SAFESUBST:#if:archive-date|archive-date=}} and |{{SAFESUBST:#if:archive-url|archive-url=}} parameters for linking to an archive copy. Non-<{{#if:|code|span}}>{{cite xxx{{#if:||{{{1}}}}}}}</{{#if:|code|span}}> citations can use {{webarchive}}.
Using {{Dead link}} will place a note by the URL and add the article to one of the Category:Articles with dead external links categories.
Append this template directly after the link (after the link code's terminating ] if you are using wikitext), or, if you are using a <{{#if:|code|span}}>{{cite xxx{{#if:||{{{1}}}}}}}</{{#if:|code|span}}> template, directly after the <{{#if:|code|span}}>{{cite xxx{{#if:||{{{1}}}}}}}</{{#if:|code|span}}> transclusion (not inside it), but inside the reference, if any, i.e. before the </ref>, in all cases leaving the original link intact:
<ref>{{cite web|url=http://www.example.org|title=The Example Website|access-date=22 September 2012}}{{Dead link|date=June 2026}}</ref>
For bare links, leave a space after the end of the URL and the template:
* http://www.example.org {{Dead link|date=June 2026}}
Otherwise automated tools can have trouble determining where the URL ends, because it will ambiguously contain URL-encoding and wiki-encoding mixed together.
Not following these syntax rules might hinder detection by automated tools. If the citation contains multiple URLs (e.g. chapter-url and url) in a template, and only one is broken, you can use wiki comments like <!-- <your hidden explanation here> --> to explain which one is broken.
If the article uses clickable footnotes, then this template should be placed just before the </ref> that contains the dead link. The notice will then correctly appear in the reference section instead of in the body of the text, and so WP:Link rot bots can properly find and fix the link.
If you are placing this template inside a <ref> </ref> reference, do not leave any substitution template such as {{subst:CURRENTMONTHNAME}} or {{subst:CURRENTYEAR}}, because substitutions fail inside ref tags.
Avoid using this template when the reference is fully adequate without the link. In this case, simply remove the link. For example, if a {{cite journal}} template is used with a DOI, remove the |{{SAFESUBST:#if:url|url=}} parameter.
- Common form (with current date)
{{Dead link|date=June 2026}}
Optional parameters
url- Provides a history of the linked page via the Wayback Machine. Set only if history actually exists, as otherwise it is misleading to users and editors.
date- The date parameter consists of the full English name of the current month with initial capital, a space, and the year, not full dates; e.g., "January 2013", but not "jan13" or " 15 January 2013". Any deviation from these two rules will result in an "invalid date parameter" error.
bot- Bot accounts specify the
|bot=parameter as a sign that the tag was added by an automated process. Set asbot=<bot name>. fix-attempted- Set this to "yes" if you have tried unsuccessfully to find an archived copy, or a copy with a different URL. This will put the page in Category:Articles with permanently dead external links, and the annotation will be rendered as "{{#switch:¬
|¬= |SUBST=
}}{{#if:|{{#ifeq:{{{name}}}|Dead link||{{#if:July 2022||}}}}}}{{#if:
|[{{#if:
|{{{pre-text}}}
}}{{#if:
| {{{post-text}}}
}}]|[{{#if: |dead link|{{#if:yes|permanent dead link|dead link}}}}]
}}" instead of just "{{#switch:¬
|¬= |SUBST=
}}{{#if:|{{#ifeq:{{{name}}}|Dead link||{{#if:July 2022||}}}}}}{{#if:
|[{{#if:
|{{{pre-text}}}
}}{{#if:
| {{{post-text}}}
}}]|[{{#if: |dead link|{{#if:|permanent dead link|dead link}}}}]
}}". Note that this currently will occur for any value supplied, including "no", so if a fix was not attempted, simply leave this parameter off, or set it to be blank. Also note that if a page cannot be found in the Internet Archive (Wayback Machine), often a live copy can be found via a web search for the full title, in quotes, on the original website, or on the Internet at large. Alternatively, you can use {{Permanent dead link}} as a shortcut to using this parameter.
Notes:
- The date-substitution template may be used to automatically generate the date, e.g.,
{{Dead link|{{subst:DATE}}}}. See Help:Substitution for more information. - The
date=parameter need not be added by the editor: if not entered, a bot will soon add it.
Examples
<ref>{{cite web |url=http://www.example.org |title=Web page title |website=Example.com |access-date=22 September 2012}} {{Dead link |date=September 2012}}</ref>
→ <ref>Lua error in Module:Citation/CS1/Configuration at line 2288: attempt to index field '?' (a nil value). {{#switch:¬
|¬= |SUBST=
}}{{#if:|{{#ifeq:{{{name}}}|Dead link||{{#if:September 2012||}}}}}}{{#if:
|[{{#if:
|{{{pre-text}}}
}}{{#if:
| {{{post-text}}}
}}]|[{{#if: |dead link|{{#if:|permanent dead link|dead link}}}}]
}}</ref>
<ref>{{cite news |title=Sorrell accuses Murdoch of panic buying |author=Plunkett, John |url=http://media.guardian.co.uk/site/story/0,14173,1601858,00.html |newspaper=[[The Guardian]] |date=27 October 2005 |access-date=22 September 2012}} {{Dead link}}</ref>
→ <ref>Lua error in Module:Citation/CS1/Configuration at line 2288: attempt to index field '?' (a nil value). {{#switch:¬
|¬= |SUBST=
}}{{#if:|{{#ifeq:{{{name}}}|Dead link||{{#if:||}}}}}}{{#if:
|[{{#if:
|{{{pre-text}}}
}}{{#if:
| {{{post-text}}}
}}]|[{{#if: |dead link|{{#if:|permanent dead link|dead link}}}}]
}}</ref>
{{#switch:{{{liststyle}}}|upper-alpha|upper-roman|lower-alpha|lower-greek|lower-roman=}}{{#if:|
| {{#iferror: {{#ifexpr: 1 > 1 }} |style="column-width: calc( 0.9 * {{{1}}} );"}}
| {{#if: |style="column-width: calc( 0.9 * {{{colwidth}}} );"}}
}}><references group="" responsive="0"></references>|
Caveats
- Avoid using free/bare links without a separator (e.g.
http://www.example.org/{{Permanent dead link}}). Frequently software is unable to differentiate the URL from the template, and will interpret the template as a literal part of the URL. Add square brackets or a space separating the template from the URL. Correct:http://www.example.org/ {{Permanent dead link}}and Correct:[http://www.example.org/]{{Permanent dead link}} - Avoid complicated formatting. Nesting inside another template is not generally supported.
- Avoid using [ ] { | } < > characters between the end of the external link and {{Permanent dead link}}, as they are often used to format text.
TemplateData
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3ADead+link%7CDead+link%7CDead+link%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|S|s}}ee a monthly parameter usage report] for {{#if:Dead link|Template:Dead link|this template}} in articles{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Dead link|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3ADead+link%7CDead+link%7CDead+link%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Dead link|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3ADead+link%7CDead+link%7CDead+link%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report] for {{#if:Dead link|Template:Dead link|Template:Dead link}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Dead link|its|this}} TemplateData}}.
|#default=[1]{{#ifeq:{{safesubst:#switch: y |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Dead link|its|this}} TemplateData}} }}|This is the {{#if:|TemplateData|TemplateData}} for this template used by TemplateWizard, VisualEditor and other tools. {{#switch:
|=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3ADead+link%7CDead+link%7CDead+link%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|S|s}}ee a monthly parameter usage report] for {{#if:Dead link|Template:Dead link|this template}} in articles{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Dead link|its|this}} TemplateData}}.
|None|none=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3ADead+link%7CDead+link%7CDead+link%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report]{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Dead link|its|this}} TemplateData}}
|for|For=[https://bambots.brucemyers.com/TemplateParam.php?wiki=enwiki&template=%7B%7B%23if%3ADead+link%7CDead+link%7CDead+link%7D%7D {{#ifeq:{{safesubst:#switch: {{{lc}}} |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|no|P|p}}arameter usage report] for {{#if:Dead link|Template:Dead link|Template:Dead link}}{{#ifeq:{{safesubst:#switch: y
|no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Dead link|its|this}} TemplateData}}.
|#default=[2]{{#ifeq:{{safesubst:#switch: y |no |n |f |false |off |0 = no | = no |¬ = no |yes |y |t |true |on |1 = yes |#default = no
}}|yes| based on {{#if:Dead link|its|this}} TemplateData}} }}}}
TemplateData for Dead link
{{#if:
| {{{demospace}}}
| {{#ifeq:Template|Template
| template
| other
}}
}}
| template = {{safesubst:#if:{{safesubst:#ifeq:Dead li|sandbox|1}}{{safesubst:#ifeq:Dead link|doc|1}}||
}} | other | #default = }} <templatedata> { "description": "A template to indicate that the preceding URL is dead", "params": { "date": { "label": "Month and year", "description": "The month and year the URL was found to be dead, like \"June 2013\"", "type": "string", "autovalue": "{{subst:CURRENTMONTHNAME}} {{subst:CURRENTYEAR}}", "suggested": true }, "bot": { "label": "Bot name", "description": "The name of the bot used to identify the dead link (not used by regular editors)", "type": "wiki-user-name" }, "url": { "label": "Wayback URL", "description": "The dead URL, used only if there is a Wayback Machine archive", "type": "url" }, "fix-attempted": { "label": "Fix attempted", "description": "Setting to 'yes' (or any non-blank value) indicates that no archive copy is available", "type": "boolean", "example": "yes" } }, "format": "inline" } </templatedata>
See also
- {{Citations broken}}
- {{Cleanup bare URLs}} header
- {{Closed access}} and {{Open access}} citation flags
- {{Dead YouTube link}}
- {{Full citation needed}} (inline) to be used when a reference suffers from a more severe problem than a mere broken link
- Link rot
- {{Permanent dead link}}
- {{Registration required}} citation flag
- {{Subscription or libraries}} citation flag for when a subscription or library access may be required
- {{Subscription required}} citation flag
- {{Webarchive}}
- What to do when a reference link goes dead
- {{Website defunct}} to be used in place of the {{URL}} parameter in infoboxes for defunct websites
Dead link tools
- Probably of historical interest only:
{{safesubst:#if:{{safesubst:#ifeq:Dead li|sandbox|1}}{{safesubst:#ifeq:Dead link|doc|1}}|| }}
- Pages with script errors
- Templates needing substitution checking
- Pages with incorrectly substituted templates
- Templates including undated clean-up tags
- Pages with broken file links
- Documentation subpages without corresponding pages
- Templates using TemplateData
- External link maintenance templates
- Inline citation cleanup templates