(Redirected from Meta:AutosuggestSitelink)

AutosuggestSitelink is a gadget that suggests Wikidata items for possible linking with a Wikimedia site page, using interwiki linking. It was created by the Community Tech Wishathon, based on the Community Wishlist Survey 2022 proposal Autosuggest linking Wikidata item after creating an article. It is ultimately intended to be usable with all Wikimedia sites that can be linked with Wikidata (e.g., Wikipedia, Wikinews, Wikiquote, Wikisource, Wikivoyage, Wikibooks, and Wikimedia Commons), but has been tested only with Wikipedia.

Overview of functionalityEdit

As explained in Wikidata:Wikipedia and Help:Sitelinks, Wikidata sitelinks are used in the maintenance of interlanguage links, the insertion of Wikidata information into Wikipedia infoboxes, and in other ways. AutosuggestSitelink exists to facilitate the creation of these sitelinks.

AutosuggestSitelink searches Wikidata for items that might be appropriate for linking to a Wikipedia article (or other site page). The search is based on the title of the page just edited. If candidate items are found, AutosuggestSitelink allows quick creation of a new link with an item chosen by the contributor. If none are found, AutosuggestSitelink offers to provide a link allowing for the creation of a new Wikidata item.

Important: AutosuggestSitelink does not determine the appropriateness of any Wikidata item for linking to the article. Before linking to an item, it is important for the contributor to verify its appropriateness. If appropriateness cannot verified, it is better not to make the link. This is true even if AutosuggestSitelink returns just a single candidate item.

Before creating a new Wikidata item, the contributor should verify that an appropriate item does not already exist. This should be done even if AutosuggestSitelink has reported that no matches were found.

Some general guidelines for Wikidata sitelinks are given in Help:Sitelinks.


AutosuggestSitelink is triggered when a contributor publishes changes to a Wikipedia article (or other type of site page).

  • If the article is already linked with a Wikidata item, AutosuggestSitelink does nothing.
  • Otherwise, AutosuggestSitelink searches for candidate Wikidata items for linking.
    • If no search matches are found, the contributor is given an opportunity to create a new Wikidata item corresponding to the article just edited. Before doing this, the contributor should determine that no such Wikidata item currently exists, as discussed above.
    • If search matches are found, they are presented in a list. Before making a selection, the contributor should determine which, if any, of the listed items represents the main subject of the article, as discussed above.  Once an appropriate Wikidata item has been identified in the list, the contributor can link to that item by selecting it and then clicking Publish.
      • Linking to an item is optional. If the contributor prefers not to create a link, they may simply close the dialog.


Installing globally (recommended)Edit

  1. First, make sure you are registered and logged in. Only logged-in users can install user scripts.
  2. Click here to edit your global.js file.
  3. Add the following lines (This code will check if the local wiki has a gadget also named AutosuggestSitelink):

    if ( mw.loader.getState( 'ext.gadget.AutosuggestSitelink' ) !== null ) {
        mw.loader.load( 'ext.gadget.AutosuggestSitelink' );
    } else {
        mw.loader.load( '' );

  4. Save the page and bypass your cache to make sure the changes take effect.

Installing as a gadgetEdit

Individual wikis may install AutosuggestSitelink as a local gadget, but this is not yet recommended while we add finishing touches. Installing globally is always recommended for individual users, so that the tool is available on all wikis.

If you are an interface administrator and would like to install AutosuggestSitelink as a gadget on your wiki, follow these steps:

  1. Create MediaWiki:Gadget-AutosuggestSitelink-local.js with the following:
  2. Add the following to MediaWiki:Gadgets-definition:
  3. Add a description for the gadget at MediaWiki:Gadget-AutosuggestSitelink-local, preferably linking to this page ([[meta:AutosuggestSitelink]])


Please report any issues either on the talk page here, or on Phabricator with the #AutosuggestSitelink project.


The source code for the gadget is maintained on GitLab at gitlab:repos/commtech/autosuggest-sitelink. See the README for more information about how to contribute.