Wikipedia:AutoWikiBrowser/General fixes

Chapters: Core · Database scanner · Find and replace · Regular expressions · General fixes

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 <includeonly> or <noinclude>.

Fix dates (FixDates)

Template Redirects (TemplateRedirects)

Multiple issues (MultipleIssues)

DEFAULTSORT insertion and fixes (SetDefaultSort)

People Categories (FixPeopleCategories)

Fix syntax (FixSyntax)

Citation templates (FixCitationTemplates)

Redirect tagger (RedirectTagger)

Fix syntax inside redirects (FixSyntaxRedirects)

Add missing {{Reflist}} (AddMissingReflist)

Duplicate Named References (DuplicateNamedReferences)

Duplicate Unnamed References (DuplicateUnnamedReferences)

Fix Date Ordinals/Of (FixDateOrdinalsAndOf)

This is a MOS and minor fix

Fix categories (FixCategories)

Fix empty references (SimplifyReferenceTags)

Fix images (FixImages)

Fix main article (FixMainArticle)

This is a MOS fix

Fix non-breaking spaces (FixNonBreakingSpaces)

This is a MOS fix

Fix reference tags (FixReferenceListTags)

Fix temperatures (FixTemperatures)

FixReferenceTags (FixReferenceTags)

Mdashes (Mdashes)

This is a MOS fix (see WP:DASH)

Remove empty comments (RemoveEmptyComments)

ReorderReferences (ReorderReferences)

SameRefDifferentName (SameRefDifferentName)

References after punctuation (RefsAfterPunctuation)

Sort meta data (MetaDataSorter)

Interwikis (Interwikis)

  • Removes duplicate interwikis.
  • Unicodifies interwiki links.
  • 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)

  • Removes duplicate categories.
  • Moves categories to correct position in article per WP:ORDER.
  • Moves any {{DEFAULTSORT}} to be just above categories per WP:ORDER.
  • On sl-wiki only, moves {{Lifetime}} to be just above categories.

Maintenance Tags (MoveMaintenanceTags)

  • Moves maintenance tags to appropriate place per WP:ORDER
  • Deduplicates tags, uses earliest |date= if multiple tags with different |date= values.

Deletion/Protection Tags

  • Moves deletion/protection tags to appropriate place, above maintenance tags, per WP:ORDER
  • Moves {{Link FA}}/{{Link GA}} immediately above interwikis per template's documentation.

  • 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)

  • Moves any {{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)

  • 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

  • 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.

Cite Template Dates (CiteTemplateDates)

Bold titles (BoldTitle)

Not applied if page has an imagemap on the page or noinclude transclusion

MinorFixes

Interwiki conversions (InterwikiConversions)

  • Performs some interwiki conversions fixing typos: "da" instead of "dk", "no" instead of "nb", "zh" instead of "zh-tw".

English-language fixes

Template conversions (Conversions)

Fix People life date ranges (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)

  • 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)

Merge Portals (MergePortals)

Mainspace tagger

Mainspace tagger skips redirects and soft redirects to wiktionary.

Tagger (Tagger)

  • Removes {{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 {{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 {{Orphan}} if article has more than 2 incoming links.
  • Appends {{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, {{Chembox}} and {{Drugbox}} are excluded from wikilink and size count).
  • Appends {{stub}} if article has at most 300 characters (comments, categories, persondata, infoboxes and {{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 {{Uncategorized stub}} if article has no categories and is a stub.
  • Appends {{Uncategorised}} if article has no categories, has more than 6 words outside of templates/tables/comments, and is not a stub (or renames {{improve categories}}). It removes the tag in case article has at least 1 category.
  • Appends {{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.
  • Adds {{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 {{Empty section}}. (en-wiki only)
  • Changes {{Unreferenced}} to {{More citations needed}} if article has existing references.

Dated tags (TagUpdater)

  • Adds |date=Month YYYY to some of the most common by-date cleanup or maintenance templates (see Category:Wikipedia maintenance categories sorted by month)
    • Takes list from dated templates.
    • Converts first letter of |date= to uppercase e.g. |date=may to |date=May.
    • Corrects upper case month name e.g. |date=MAY to |date=May.
    • Corrects mixed case month name e.g. |date=MAy to |date=May. (e.g. diff)
    • Corrects |Date=, |dates= parameter typos.
    • Adds |date= when missing for Month YYYY argument.
    • Removes day in International date in |date=.
    • Removes comma between month and year. (e.g. diff)

Talk page general fixes

Note: When making fixes to talk pages, it is helpful to also use the custom module User:Magioladitis/WikiProjects for template redirects.

General

WikiProjectBannerShell fixes (WikiProjectBannerShell)

(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 |collapsed=no
  • Bypasses redirects
  • Adds explicit call to first unnamed parameter |1= if missing.
  • If WikiProject Biography exists inside the shell:
    • with |living=no then removes |blp=yes if exists
    • with |living=yes then adds |blp=yes
    • with |blpo=yes then adds |blpo=yes
  • If {{blp}} found then removes it and adds |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)

  • Remove diacritics from |listas=
  • Removes {{blp}} from talk page if {{WikiProject Biography|living=yes}}
  • Moves {{WikiProject Biography}} above any WikiProject templates if it has |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)

  • Converts {{sir}} to {{WikiProject Songs|needs-infobox=yes}}
  • Removes unsupported |importance= from {{WikiProject Songs}}
  • Removes |needs-infobox=no
  • Note: This function is applied to en.wiki only

WikiProject Jazz fixes (WPJazz)

DEFAULTSORT fixes

  • Replaces the {{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:

  • <source>, <syntaxhighlight>, <nowiki>, <pre>, <math>, <timeline> tags.
  • HTML comments.
  • (If option set) External links.
  • (If option set) Image/File links including those in infobox fields on en-wiki, <imagemap> tags, |title=, |trans_title= within citation templates.

HideMore

Items hidden are:

  • All those in Hide.
  • Templates, including nested templates.
  • <blockquote>, <code>, <noinclude>, <includeonly> tags.
  • Headings.
  • (If option set) wikilinks.
  • Text indented with a colon.
  • <cite> and <ref> tags.
  • Untemplated quotes: text in straight quotes (and equivalent smart/curly quotes)
  • (If option set) text in italics.
  • <p style...> 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
    • Page is a disambiguation page
    • Page contains "List of…", "Murder of…", "Deaths…", "discography", "murders", "…musical groups", "People from…", etc.
    • Page begins with a two or more digit number
    • Page is tagged {{in universe}}
    • Page has {{Infobox musical artist}} where |background= is group_or_band/classical_ensemble/temporary/cover_band
    • ...and more
    • Zeroth section has a {{Main}} or {{See also}} link
    • Zeroth section infobox is not a person infobox
    • Multiple {{Birth date}} templates (or similar) with different dates
    • Page has more than one of the common person infoboxes
    • Wikilink within bold text in zeroth section and not within a template
    • Page is in Category:Internet memes
    • Page is in Category:Military animals
  • If no criteria to return false, criteria that return true:
    • Page contains {{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 {{Birth date}} or {{Death date}} template in zeroth section
    • Page has {{BLP sources}} or {{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.
  • 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 |df=y or |mf=y (or yes) in the {{birth date}} family of templates.
    • If none of the above criteria allow a derivation, the date format is undetermined.

Persondata completion (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)
  • 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 {{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 {{DEFAULTSORT}}.
  • PLACE OF BIRTH and PLACE OF DEATH
    • Sets persondata locations based on |placeofbirth= and |placeofdeath= fields (and aliases) from people infoboxes.
  • ALTERNATIVE NAMES and SHORT DESCRIPTION fields are not automatically populated.

See also