User:Citation bot/use

Citation bot is a piece of software designed to expand and fix citations on Wikipedia, making referencing easier. This guide will help you get the best results with Citation bot. There is no need to painstakingly enter and copy-paste author names, date, source titles, and page numbers anymore. Now you can type or paste in only the DOI, PMID, S2CID, or, the Google Books URL, and let the bot do the rest! It will also try to fix a variety of common errors with existing citations, and tidy them up as best it can.

See simple cases below to quickly see how to get the most out of Citation bot. See also how to deal with mistakes.

How to activate Citation bot
Note: Most methods of activating the bot will require a valid user account that has granted the Citation Bot permission to authenticate using OAuth (the bot will prompt for this). One exception to this is the button of the citation expander, which will work right away, and which is also the only method that will work if the bot is blocked.

via the web interface
The bot can be activated directly at https://citations.toolforge.org/. There will be a few options, including the ability to run the bot on all articles in a category (use with care, as those could be very numerous).

via templates
Certain templates will give links to activate Citation bot automatically (and possibly other tools). This may look like

Simply click on the Citation bot link and you're done!

As of writing, the following templates will present editors with Citation bot links:


 * AFC/Draft templates
 * AFC submission: Used during the Article for Creation process.
 * Draft article: Designed for drafts, simply copy-paste  at the top of the page
 * Userspace draft: Specifically designed for userspace drafts, simply copy-paste  at the top of the page


 * Citation templates
 * cite arXiv: A link will appear when the cite arXiv template is incomplete


 * Tool templates
 * Automated tools: Designed to be used in other templates, such at Draft article. Should rarely be used directly.

via the citation expander gadget
To enable the citation expander gadget, go to your preferences and click on the "Gadgets" tab. Scroll down to the "Editing" section, and tick the "Citation expander" box. Then scroll down to the bottom of the page and click "". There are minor incompatibilities with wikEd.

Once you have done this, two things will happen (see image in top right).
 * 1) There will be a  button below the editing window between the  and  buttons (the exact appearance may differ). Clicking on the button will initiate the bot. The bot will then complete/fix references and return you to the article edit box. Above this box you will see a "diff" of the page as it looked before (on the left) and after (on the right) the bot examined it. If no changes were made then you will see the words "No difference" in parentheses above the edit box. You can now review the changes and edit normally. Once you are happy with the results, click, and you're done!
 * 2) There will be an "Expand citations" link in your toolbar (normally on the left when editing from a desktop/laptop) where the bot can be activated directly. The bot  will present a summary log and save its changes automatically, if any are made. If the log is too complex for you, scroll down to the bottom, and there will be a final line
 * (if a change is made)
 * (if no change is made)
 * You can then click on 'diff' to review the changes the bot made.

via user scripts
For advanced users. Most people should use the Citation expander gadget instead. Examples of user scripts would include
 * User:Smith609/citations.js
 * User:Headbomb/citations.js

Simple cases: DOI / GoogleBooks
To add a reference to a peer-reviewed article with a digital object identifier (DOI), simply type
 * or

where you want to insert a citation (copy and paste your own DOI code from wherever you are getting your reference). Other identifiers are also supported.

Likewise, to add a reference to a book you have found on Google Books, just type


 * or

where you want to insert a citation. Other websites are also supported.

You can add multiple such references at once if you want. Now simply save the page and activate the bot!

Supported identifiers
More than just DOIs are supported in citation templates.

For arXiv preprints, use For books, use For conference proceedings with DOIs, use For journals, use any of and run the bot as usual. For example  gets converted to Note that you might still need to review for errors or style in some cases, to produce the desired

Supported URLs
The bot will convert select raw URLs when placed between  to the correct citation templates. This is particularly useful if you don't want to figure out which template is best to use, or what exactly the identifier is, or if just want to save yourself a few keystrokes. Like above just save the page and you can set the bot on it. The supported URLs and conversions are: Note that this will usually not work on URLs with formatting, like. To convert those to citation templates, simply remove the formatting before running the bot.
 * → (or →   if a doi is found)
 * Most Semantic Scholar URLs, such as ; still, the bot code limits the use of this type of URL, since many of these URLs only lead to a landing page with a DOI link out—the bot only converts raw Semantic Scholar URLs to a  article when such article at Semantic Scholar has useful content not available otherwise. An example of such useful content is the article's full-text PDF;
 * Most Semantic Scholar URLs, such as ; still, the bot code limits the use of this type of URL, since many of these URLs only lead to a landing page with a DOI link out—the bot only converts raw Semantic Scholar URLs to a  article when such article at Semantic Scholar has useful content not available otherwise. An example of such useful content is the article's full-text PDF;
 * Most Semantic Scholar URLs, such as ; still, the bot code limits the use of this type of URL, since many of these URLs only lead to a landing page with a DOI link out—the bot only converts raw Semantic Scholar URLs to a  article when such article at Semantic Scholar has useful content not available otherwise. An example of such useful content is the article's full-text PDF;
 * Most Semantic Scholar URLs, such as ; still, the bot code limits the use of this type of URL, since many of these URLs only lead to a landing page with a DOI link out—the bot only converts raw Semantic Scholar URLs to a  article when such article at Semantic Scholar has useful content not available otherwise. An example of such useful content is the article's full-text PDF;
 * Most Semantic Scholar URLs, such as ; still, the bot code limits the use of this type of URL, since many of these URLs only lead to a landing page with a DOI link out—the bot only converts raw Semantic Scholar URLs to a  article when such article at Semantic Scholar has useful content not available otherwise. An example of such useful content is the article's full-text PDF;
 * Most Semantic Scholar URLs, such as ; still, the bot code limits the use of this type of URL, since many of these URLs only lead to a landing page with a DOI link out—the bot only converts raw Semantic Scholar URLs to a  article when such article at Semantic Scholar has useful content not available otherwise. An example of such useful content is the article's full-text PDF;
 * Most Semantic Scholar URLs, such as ; still, the bot code limits the use of this type of URL, since many of these URLs only lead to a landing page with a DOI link out—the bot only converts raw Semantic Scholar URLs to a  article when such article at Semantic Scholar has useful content not available otherwise. An example of such useful content is the article's full-text PDF;

You can also use the identifiers URLs in templates, rather than the identifier code. For example, instead of

you can add

and the bot will work as usual.

Other URLs to large repositories like Academia.edu, ResearchGate, ScienceDirect, SpringerLink or Wiley Online Library, will often (but not always) work too.

Additional fixes
The bot will also attempt to make things right en masse on already-present citations and correct a range of common errors from misspelled parameters (Year → year), to capitalization mistakes (JOURNAL OF PHYSICS → Journal of Physics), to the wrong template being used ( → ).

... the bot is blocked?
Occasionally the bot is blocked due to bugs that the maintainer has not had time to fix. When this happens, the bot itself cannot commit edits, but you can still install its changes by hand. However, you should take special care when this occurs, as the bot-induced bugs are not always obvious. Sometimes, for example, the bot might break wikilinks to a citation, and this will not be easily observable simply by reading the resulting citation.

If the bot is blocked, you can still use the "Citation bot" button, if you have the widget installed. Just be doubly sure to check that you are not introducing errors.

... no changes are made by the bot?
New users; please note that the results when no changes are made can be confusing. You will see this at the top of the page:


 * Latest revision _______ Your text.

Followed immediately by the edit window. That means that no changes have been made. If you save the page hoping for some improved citations, you will see no changes, and nothing will show up in the revision history.

If you click and there are changes made, the bot will show them to you before they are saved. It is very clear. This allows you to choose whether to make further changes before saving.

... the bot made a mistake?
Many bot mistakes will be due to poor template usage. First consult the documentation to make sure you are using the templates correctly (for example, if there's an issue with how the bot deals with cite journal, look at the documentation found at Template:Cite journal). If this is intimidating, you can ask for help at the citation template help page and someone will help you figure things out. The bot does however make genuine mistakes. Most will occur because of bad metadata, which can be dealt with using the below methods. However some will occur because of bad bot logic, in which case you should report the bug.

When dealing with bad metadata, or when the bot keeps repeating a mistake, you can prevent the error from happening again with the following methods:
 * If the bot messes a specific parameter, like change a correct 13-45 to #Chemistry;%34, put a comment in it (any comment will do)
 * 13-45
 * This will prevent the bot from overwriting the parameter. This is usually due to bad metadata. If it is a bug however, please report it!


 * If the bot adds an inappropriate parameter, like Corporation, Inc. Acme, put a comment in the bad parameter
 * last3 first3
 * This will prevent the bot from re-adding the parameter. Again, this is usually due to bad metadata. If it is a bug however, please report it!


 * If the bot messes an entire citation, for instance if it inappropriately converts a cite journal to a cite book, put a comment in the template name
 * This will tell the bot to not touch this citation at all. Again, this is usually due to bad metadata. If it is a bug however, please report it!
 * This will tell the bot to not touch this citation at all. Again, this is usually due to bad metadata. If it is a bug however, please report it!


 * This bot does not use cbignore, despite the name being similar.

... you have a suggestion?
If you have an idea for how the bot can be even more helpful, please bring it up here.