General fixes is a set of semi-automated edits that are enabled by default in AutoWikiBrowser. They are intended to be uncontroversial and require minimal human oversight; many are cosmetic and improve wikitext readability but do not affect display to readers.
This page lists the general fixes, although it may not be exhaustive. General fixes are optimised for en-wiki with some variation for other language wikis. Not all general fixes are suitable for all languages. Some general fixes are disabled on pages containing {{tag|includeonly|open}} or {{tag|noinclude|open}}.
Keeps first letter case of the redirect in the new template name, except for acronym templates (first three letters uppercase) where the template is forced to uppercase.
Handles nested templates
Multiple issues (''MultipleIssues'')
{{Anchor|MultipleIssues}}
Applies fixes to {{tl|Multiple issues}} (formerly {{tl|Article issues}}), en-wiki only
removes template if it has no parameters.
(old format templates) converts it to the original template if it has only one parameter (e.g. {{Diff|Clowns_%28video_game%29&|386897589|386897541|diff}}).
(old format templates) removes invalid parameters such as {{para|date}}
merges other supported tags into it
(old format templates) Corrects casing of exiting parameters
Adds 2 or more single tags into new {{tl|Multiple issues}}
Templates are added within {{tl|Multiple issues}} on separate lines
When not in zeroth section, includes {{para|section|yes}} parameter
Removes blank lines
(new format templates) converts to original template if only one template in {{tl|Multiple issues}}
Does not operate if an article level-2 section has more than one {{tl|Multiple issues}}
Merge multiple DABLinks (''Dablinks'')
{{Anchor|Dablinks}}
Cleans and merges multiple DABLinks per WP:DISAMBIG. Called by Conversions function.
Removes about as first word of the first parameter of {{tl|About}} e.g. {{about|about foo}} to {{about|foo}}
{{DEFAULTSORT: McDoe, John}} to {{DEFAULTSORT: Macdoe, John}} per WP:MCSTJR. (Check this. WP:MCSTJR contradicts: "Surnames beginning with Mac or Mc are sorted as they are spelled.")
"Person of Place" generates sort key of "Person Of Place"; also "Person II of Place" generates "Person 02 Of Place" per WP:PEERS and WP:COP.
Adds a DEFAULTSORT where the article title does not match the rules above.
DEFAULTSORTs are not added or changed when the only difference is letter casing.
NOTE: AWB does not meet all of the (various) rules on DEFAULTSORT on en-wiki; it may not meet all of the rules on other wikis either. It may never be possible to meet all of the rules. An option is provided under the Options menu to turn off all changes/insertion of DEFAULTSORT.
Performs various fixes to citation templates (en only):
Renames invalid {{para|pg}} to {{para|page}} (e.g. {{diff|Don_Nardo|388648280|388644925|diff}}).
Removes empty fields where the field has already been specified elsewhere.
Corrects common typos in {{para|accessdate}}, {{para|format}}, {{para|language}} and {{para|publisher}} field names (e.g. {{diff|Marx_House|prev|386603117|diff}}).
Removes excess pipes.
Removes the unneeded {{para|format|HTML}} field
Removes {{para|language}} when it is English per citation templates manuals
Removes {{para|format}} field with null value when URL is HTML page
Removes italics for {{para|work}} field for book/periodical, but not website (auto italicised by template)
Removes quotes around {{para|title}} field since they are automatically added by template markup
{{tl|Dead link}} moved from {{para|format}} field to after citation per Template:Dead link.
Converts newlines to spaces in citation titles when URL is present (otherwise display is incorrect).
Renames {{para|authors}} to {{para|author}} in {{tl|cite web}}.
For {{tl|cite journal}} only: extracts issue/number information from {{para|volume}} and moves to {{para|issue}}
Converts {{para|id|ISSN 1234-5678}} or {{para|ID|ISSN 1234-5678}} to {{para|ISSN|1234-5678}} provided {{para|ISSN}} and {{para|issn}} not already populated and {{para|id}} contains valid ISSN
Formats {{para|ISSN|12345678}} or {{para|ISSN|1234 5678}} to {{para|ISSN|1234-5678}} provided {{para|ISSN}} is 8 digits (supported for {{para|issn}} as well)
Where an article uses named references (see WP:REFNAME), duplicate copies of the same reference are condensed to the abbreviated format of .
The change is subject to a minimum reference length.
References using the same name and same reference value are condensed (this does not change the appearance of the page to the reader).
Unnamed references with the same reference value are condensed.
Leading and trailing whitespace is ignored when deciding if two references are the same.
Named references are not condensed if the first declaration is in a template call, because we cannot be sure the template will display all of its parameters (and hence the reference) and do not want to create an undefined reference error
Note: This change is fully compatible with the Harvard referencing style.
Duplicate copies of the same reference are condensed by setting the references as named references (see WP:REFNAME), and condensing per Duplicate Named References logic.
The references must be identical except for any leading or trailing whitespace.
The change is subject to a minimum reference length.
The references cannot be of the ibid type.
The references cannot have a {{tl|page needed}} template.
The article must already have at least one named reference (to avoid a 'change in citation style' in the article per WP:CITEVAR). This means at least one named ref in short format () as a full named ref by itself does not cause any references to display as combined.
The reference name is derived by use of the author name, year & page where available, otherwise trans-title/title, otherwise publisher, otherwise website of URL, otherwise fields from the Harvard family of templates, otherwise full reference if short, otherwise a generic reference name of 'ReferenceA' etc.
Note: This change is fully compatible with the Harvard referencing style.
Fix Date Ordinals/Of (''FixDateOrdinalsAndOf'')
{{Anchor|FixDateOrdinalsAndOf}}
This is a MOS and minor fix
Performs various fixes in compliance with WP:DATE, but not on text in quotes, templates, wikilinks, etc.:
Removes ordinals from full dates per WP:DATESNO; does not alter on the 3rd November 2008 (i.e. the plus ordinal) to avoid introducing bad grammar.
Removes 'of' between a month and a year per WP:DATESNO.
Removes leading zeros from the day in full dates per WP:DATESNO.
Adds a comma if missing to full American-format dates per WP:DATEFORMAT.
Note: This function can be disabled by disabling WP:MOS fixes under the Options menu (Option designed for third-party wikis/other language wikis that are not en-wiki).
Fix categories (''FixCategories'')
{{Anchor|FixCategories}}
Sets first alphabetical character in category name to be upper case.
Removes diacritics and trailing whitespace from category sortkeys per WP:SORTKEY.
Removes unnecessary whitespace around category call.
Removes the (unneeded) sort key from categories if a {{DEFAULTSORT}} entry is present with the same sort key.
Note: The use of a single space as a category sortkey is supported.
Fix empty links and templates (''FixEmptyLinksAndTemplates'')
{{Anchor|FixEmptyLinksAndTemplates}}
Removes empty wikilinks, category links, and template calls: e.g. empty , Category:, and {{}}.
Fix empty references (''SimplifyReferenceTags'')
{{Anchor|SimplifyReferenceTags}}
Condenses reference tags in the form with .
Fix images (''FixImages'')
{{Anchor|FixImages}}
Fix common spacing/capitalisation errors in images
Fix whitespace around Image/File call
Canonicalises images titles (underscore to space, URL encoding converted to Unicode etc.).
Inserts non-breaking spaces between amount and unit for common units, but not on text in quotes, templates, wikilinks, references, etc. per WP:NBSP.
The units supported include cd (candela), cm, km, miles, feet, inches (but not "in"), grammes, hp, Hz, GHz, kHz, MHz, kg, µg, mL, dB mol, °C, °F (see also WP:UNITS for these), and page abbreviations p. and pp. (see also MOS:NDASH for these)
Non-breaking spaces are added only before abbreviated units.
Unspaced mm are specifically excluded, as firearms use mm when it does not refer exactly to a dimension.
"m" is excluded due to its use as an abbreviation for million, except when it is immediately followed by a measurement in ft
Changes "invisible non-breaking spaces" given by Unicode characters with "visible non-breaking spaces" given by html entities per WP:NBSP.
Inserts a non-breaking space between 12-clock number and a.m. or p.m. per MOS:TIME.
Removes space and/or non-breaking space between number and percent symbol per WP:PERCENT.
Removes space and/or non-breaking space between nonalphabetic currency symbol and number per WP:CURRENCY.
Note: This function can be disabled by disabling WP:MOS fixes under the Options menu (Option designed for third-party wikis/other language wikis that are not en-wiki).
Fix reference tags (''FixReferenceListTags'')
{{Anchor|FixReferenceListTags}}
Converts the old "references-2column" style to use {{tl|reflist}}.
Text same as the title where title uses an endash.
Two consecutive hyphens within a sentence (excluding "xn--").
Replaces hyphen with Unicode minus in superscripted negative numbers.
Note: This function can be disabled by disabling WP:MOS fixes under the Options menu (Option designed for third-party wikis/other language wikis that are not en-wiki).
Remove empty comments (''RemoveEmptyComments'')
{{Anchor|RemoveEmptyComments}}
Removes HTML comments with no content other than whitespace. This feature is disactivated as a general fix at the moment but the function is still available for use.
ReorderReferences (''ReorderReferences'')
{{Anchor|ReorderReferences}}
Reorders consecutive named references such that they appear in numerical order e.g. [1][2][3] instead of [2][1][3].
Applies only to consecutive references (i.e. does not affect multiple references spread out over clauses in a sentence).
Note: This function was [https://phabricator.wikimedia.org/T154089 removed from en.wiki in 2017]
SameRefDifferentName (''SameRefDifferentName'')
{{Anchor|SameRefDifferentName}}
Condenses very short named references to the format (e.g. {{diff|Evolutionarily_stable_strategy|prev|359904314|diff}}). It is designed to catch short reference with a trivial entry such as a number or alphabetical ordering reference that is unneeded, or simply whitespace. It operates subject to these conditions:
The reference is very short
The reference is named and another full reference is present with the same name.
The reference is not to a page number.
Corrects named references where the reference is the same but the reference name is different (e.g. {{diff|Eucharist|prev|359904372|diff}})
Not applied if the reference is an 'ibid' reference or similar.
The longer reference name is used provided it is not in 'autogenerated1' or 'ReferenceA' format
References after punctuation (''RefsAfterPunctuation'')
{{Anchor|RefsAfterPunctuation}}
Puts references after punctuation (comma, full stop, colon, semi-colon) per WP:CITEFOOT and WP:PAIC, subject to:
Applies to en-wiki and simple-wiki only
Requires >= 75% refs after punctuation to convert the rest.
Whitespace before ref is cleaned when punctuation moved.
Puts many inline templates (such as {{tl|citation needed}}) after punctuation (comma, full stop, colon, semi-colon).
Sort meta data (''MetaDataSorter'')
{{Anchor|MetaDataSorter}}
Puts categories after page body, followed by stub templates and interwiki links per WP:FOOTER. Recognizes the common cat and interwiki header comments.
Sorts interwiki links alphabetically (individually selectable in menu) per Help:Interlanguage links.
Moves interwikis at the bottom of the page after stub templates per WP:FOOTER.
Removes self interwikis (does not remove current language links for monolingual projects such as Commons).
Removes double colon in interwikis. For example, it changes es::foo to es:foo.
Supports multiple interwiki links to same language and comments beside interwiki links.
=Categories (''RemoveCats'')=
{{Anchor|RemoveCats}}
Removes duplicate categories.
Moves categories to correct position in article per WP:ORDER.
Moves any {{tl|DEFAULTSORT}} to be just above categories per WP:ORDER.
On sl-wiki only, moves {{tl|Lifetime}} to be just above categories.
=Maintenance Tags (''MoveMaintenanceTags'')=
{{Anchor|MoveMaintenanceTags}}
Moves maintenance tags to appropriate place per WP:ORDER
Deduplicates tags, uses earliest {{para|date}} if multiple tags with different {{para|date}} values.
=Deletion/Protection Tags=
Moves deletion/protection tags to appropriate place, above maintenance tags, per WP:ORDER
=Featured list/article tags=
Moves {{Link FA}}/{{Link GA}} immediately above interwikis per template's documentation.
=DABlinks (''MoveDablinks'')=
{{Anchor|MoveDablinks}}
Moves DABLinks at the very top of the page per WP:HNP. (en-only)
Only moves DABLinks in the zeroth section of the article.
Removes unneeded colon before dablink.
=Portal templates (''MovePortalTemplates'')=
{{Anchor|MovePortalTemplates}}
Moves any {{tl|Portal}} templates to the top of the "See also" section per WP:SEEALSO. (en-only)
Removes duplicate portals found outside of "See also" section. (en-only)
=See also (''MoveSeeAlso'')=
{{Anchor|MoveSeeAlso}}
Moves the "See also" section to be above the "References" section, per WP:FOOTERS. (en-only)
Subject to the limitation that the "See also" section cannot be the last level-2 section
=External links (''MoveExternalLinks'')=
{{Anchor|MoveExternalLinks}}
Ensures the "External links" section of an article is after the "References" section per WP:FOOTERS.
Operates subject to the limitation that there is another section following the "References" section.
=Sister links (''MoveSisterLinks'')=
{{Anchor|MoveSisterLinks}}
Moves sister links such as {{tl|wiktionary}} and {{tl|Sister project links}} to the "External links" section, if there is such a section per WP:LAYOUT. (en-only)
Changes {{tl|Refimprove section}} to {{tl|BLP sources section}} if article has :Category:Living people.
Changes {{tl|Primary sources}} to {{tl|BLP primary sources}} if article has :Category:Living people.
Changes {{tl|Self-published}} to {{tl|BLP self-published}} if article has :Category:Living people.
Cleans up underscores in infobox template names.
Changes {{Template|section|...}} to {{Template section|...}} for the templates: "unreferenced", "wikify", "refimprove", "BLP sources", "expand", "BLP unsourced".
Removes deprecated parameter {{para|auto|yes}} from {{tl|Unreferenced}}.
==Fix People life date ranges (''FixLivingThingsRelatedDates'')==
{{Anchor|FixLivingThingsRelatedDates}}
Replaces "John Doe (b. 1978)" with "John Doe (born 1978)" and "John Doe (d. 1978)" with "John Doe (died 1978)" in the lead section of articles per MOS:DOB.
Replaces "John Doe (born: 1978)" with "John Doe (born 1978)" in the lead section of articles per MOS:DOB.
Replaces "John Doe (born on February 3, 1978)" with "John Doe (born February 3, 1978)" in the lead section of articles per MOS:DOB.
Replaces "John Doe (1978-)" with "John Doe (born 1978)" per MOS:DOB (not applied within infoboxes).
Sets endash in born/died date range per WP:ENDASH.
==Fix headings (''FixHeadings'')==
{{Anchor|FixHeadings}}
Delinks wikilinks in headings per WP:HEAD (where article has < 6 wikilinks in headings)
Corrects case of "References" section per WP:HEAD.
Fixes common naming errors of "See also" and "External links" sections. For instance it renames "External link" to "External links" per WP:ELCITE and "Also see" to "See also" per WP:SEEALSO.
Changes "Reference" to "References" and "Source" to "Sources" per WP:FNNR.
Removes colon from end of heading names
Removes <br/> from headings
If no level 2 heading in article, remove a level from all headings per WP:HEAD.
Doesn't consider the "References", "See also", or "External links" level 2 headings when counting level two headings.
Only apply if all level 3 headings and lower are before the first of "References"/"External links"/"See also".
Removes bold from headers per WP:HEAD as it makes a visible difference only in the article's table of contents.
Removes bad headings from start of article such as "About", "Description", "Overview", "Definition", "Profile", "Background", "Intro", "Introduction", "Summary" etc.
Removes heading at start of page if heading matches article title (heading not removed if not first heading)
Fixes unbalanced levels to "See also", "External links" and "References" sections (e.g. ==External links= becomes ==External links==)
Note: Does not alter optional spacing at start and end of heading (i.e. no conversion between == Heading == and ==Heading==)
Sets one blank line before each heading per MOS:HEAD, NOT for subheadings immediately after a heading
Merge See also (''MergeSeeAlso'')
{{Anchor|MergeSeeAlso}}
Merges multiple {{tl|see also}} templates into one.
Same for {{tl|see also2}}.
En-wiki only. Called by Conversions.
Merge Portals (''MergePortals'')
{{Anchor|MergePortals}}
Merges multiple {{tl|portal}} templates into a single one. En-wiki only. Called by Conversions.
Does not merge portal templates with additional named arguments (see {{tl|portal}} documentation).
Does not process any portal templates if portal template within {{tl|stack}} template.
When merging removes duplicate portals.
The {{tl|portal}} templates must be in the same section of the article, or the article must not have any headings.
=Mainspace tagger=
Mainspace tagger skips redirects and soft redirects to wiktionary.
Tagger (''Tagger'')
{{Anchor|Tagger}}
Removes {{tl|stub}} if article has more than 500 words (comments, categories, defaultsort and persondata are excluded from word count).
Words in bulleted text are divided by 2 to avoid destubbing pages with big lists and little text.
Appends {{tl|Orphan}} if article (or its redirects) has fewer than 3 incoming links (excluding redirects) and the article is not a disambiguation one or has a set index template. Read WP:ORPHAN for more details about orphan articles.
Orphan tagging can be limited to articles with 0 incoming links (excluding redirects) from the Options Menu. There is an option called "Restrict orphan tag addition to linkless pages".
Removes {{tl|Orphan}} if article has more than 2 incoming links.
Per this request, {{tl|Orphan}} is not removed if {{para|few}} is set.
Appends {{tl|Underlinked}} if article has 1–3 wikilinks or the number of wikilinks is smaller than 0.25% of article's size. Removes tag otherwise (comments, categories, defaultsort, Persondata, infoboxes, {{tl|Chembox}} and {{tl|Drugbox}} are excluded from wikilink and size count).
Appends {{tl|stub}} if article has at most 300 characters (comments, categories, persondata, infoboxes and {{tl|Drugbox}} are excluded from character count). Pages that start with "Lists of..." and "List of..." are not tagged as stubs per Wikipedia talk:Stub/Archive 14#Can lists be stubs?
Appends {{tl|Uncategorized stub}} if article has no categories and is a stub.
Appends {{tl|Uncategorised}} if article has no categories, has more than 6 words outside of templates/tables/comments, and is not a stub (or renames {{tl|improve categories}}). It removes the tag in case article has at least 1 category.
Appends {{tl|Dead end}} if article has no wikilinks (API call used to count mainspace links, blue and redlinks, so transcluded links are counted). Removes the tag otherwise.
Pages with {{tl|Centuryinbox}} are excluded from tagging
Adds {{tl|Ibid}} if article has references containing constructs such as ibid, op. cit. or loc. cit (per WP:IBID). (en-wiki only)
Tags empty level-2 sections with {{tl|Empty section}}. (en-wiki only)
Changes {{tl|Unreferenced}} to {{tl|More citations needed}} if article has existing references.
Adds {{tl|WikiProject banner shell}} if 3 or more WikiProject templates are found
:(Currently works only with WikiProject templates named "WikiProject foo" and not with their redirects, so using User:Magioladitis/WikiProjects as a custom module is helpful)
Fixes to WikiProjectBannerShell
:If WikiProjectBannerShells or one of its redirects is found, it does the following:
:*Removes any duplicated parameters if they have the same value.
:*Removes {{para|blp|no}}, {{para|collapsed|no}}
:*Bypasses redirects
:*Adds explicit call to first unnamed parameter {{para|1}} if missing.
:*If WikiProject Biography exists inside the shell:
:**with {{para|living|no}} then removes {{para|blp|yes}} if exists
:**with {{para|living|yes}} then adds {{para|blp|yes}}
:**with {{para|blpo|yes}} then adds {{para|blpo|yes}}
:*If {{tl|blp}} found then removes it and adds {{para|blp|yes}}
Moves any other WikiProjects into WikiProjectBannerShell
:(Currently works only with WikiProject templates named "WikiProject foo" and not with their redirects)
Note: This function is applied to en.wiki only
Heading fixes
Adds ==Untitled== to the first comment if it has no section header per WP:TPL.
Fixes first comment's header level to 2 per WP:TPL.
WikiProject Biography fixes (''WPBiography'')
{{Anchor|WPBiography}}
Remove diacritics from {{para|listas}}
Removes {{tl|blp}} from talk page if {{WikiProject Biography|living=yes}}
Moves {{tl|WikiProject Biography}} above any WikiProject templates if it has {{para|living|yes}} per WP:TPL
:(Currently works only with WikiProject templates named "WikiProject foo" and not with their redirects)
Note: This function is applied to en.wiki only
WikiProject Songs fixes (''WPSongs'')
{{Anchor|WPSongs}}
Converts {{tl|sir}} to {{WikiProject Songs|needs-infobox=yes}}
Removes unsupported {{para|importance}} from {{tl|WikiProject Songs}}
Removes {{para|needs-infobox|no}}
Note: This function is applied to en.wiki only
WikiProject Jazz fixes (''WPJazz'')
{{Anchor|WPJazz}}
If {{tl|WikiProject Songs}} (or any of its redirects) then add {{para|song|yes}} to {{tl|WikiProject Jazz}}
If {{tl|WikiProject Albums}} (or any of its redirects) then add {{para|album|yes}} to {{tl|WikiProject Jazz}}
Removes {{para|needs-infobox|no}}
Note: This function is applied to en.wiki only
DEFAULTSORT fixes
Replaces the {{tl|DEFAULTSORT}} template with the same magic word.
Moves the {{DEFAULTSORT}} magic word to the top.
=Helper functions=
This section documents some of the AWB functions that are used by the general fixes, but do not form part of the general fixes themselves.
Text hiding
Text hiding is a feature in AWB that allows syntax within articles to be hidden so that other changes are not applied to the text within that area e.g. typo fixing should not apply to image filenames, otherwise links to images could be broken.
AWB has two levels of text hiding: Hide and HideMore. These two functions exist in the WikiFunctions.Parse.HideText class.
=Hide=
Items hidden are:
, , ,
,
.
HTML comments.
(If option set) External links.
(If option set) Image/File links including those in infobox fields on en-wiki, tags, {{para|title}}, {{para|trans_title}} within citation templates.
=HideMore=
Items hidden are:
All those in Hide.
Templates, including nested templates.
, , , tags.
Headings.
(If option set) wikilinks.
Text indented with a colon.
and tags.
Untemplated quotes: text in straight quotes (and equivalent smart/curly quotes)
(If option set) text in italics.
tags.
IsArticleAboutAPerson
Determines whether the article is a biography page (and for people with multiple pages on their career/history/publications etc., that the page is their main page)
Criteria that return false:
Page has category of Multiple people/Married couples/Fictional.../YYYY animal.../Fictional character/Military careers/Presidencies/...characters/... noble families
If no criteria to return false, criteria that return true:
Page contains {{tl|Persondata}}
Page has birth/death year or living people category
Page has one of the common person infoboxes
Page is a {{…-bio-stub}}
Page is a {{…-politician-stub}}
Page is a {{…-writer-stub}}
One {{tl|Birth date}} or {{tl|Death date}} template in zeroth section
Page has {{tl|BLP sources}} or {{tl|Refimprove BLP}}
Note: This function is applied to en.wiki only
DeterminePredominantDateLocale
Determines the predominant date format in the article text as either: American, International, YMD (YYYY-MM-DD) or undetermined.
Follows any {{tl|use dmy dates}}/{{tl|use mdy dates}} template.
If no such template, counts the number of American, International, YMD dates in article.
If input arguments allow YMD to be considered, returns YMD if there are more YMD dates than any other.
Otherwise, returns American or International if at least 4 of those dates and that format used at least 2:1 over the other.
Otherwise, follows any use of {{para|df|y}} or {{para|mf|y}} (or yes) in the {{tl|birth date}} family of templates.
If none of the above criteria allow a derivation, the date format is undetermined.
Persondata completion (''PersonData'')
{{Anchor|PersonData}}
;Note: Persondata is now removed.
This is not called by general fixes
Inserts or updates Persondata only based on existing data in the article (e.g. {{diff|Jonathan_Jackson_%28Continental_Congress%29|386833518|360217842|diff}})
The Persondata template is inserted for all mainspace people biography articles without existing persondata.
Existing persondata can be updated, but any existing field values are not overwritten.
DATE OF BIRTH and DATE OF DEATH
Uses birth/death fields (and aliases) from people infoboxes and/or birth/death date templates such as {{tl|death date and age}} to derive birth & death dates.
Sets persondata dates using the predominant date locale used in the article.
NAME
Sets persondata name using the article's existing {{tl|DEFAULTSORT}}.
PLACE OF BIRTH and PLACE OF DEATH
Sets persondata locations based on {{para|placeofbirth}} and {{para|placeofdeath}} fields (and aliases) from people infoboxes.
ALTERNATIVE NAMES and SHORT DESCRIPTION fields are not automatically populated.
See also
The code for this is at https://sourceforge.net/p/autowikibrowser/code/HEAD/tree/AWB/WikiFunctions/Article/Article.cs#l1393