WhatLinksHere

From Gamepedia Help Wiki
Jump to: navigation, search

Special:WhatLinksHere is a powerful tool that can be used to discover articles that link to each other.

How to use[edit | edit source]

There are a few ways to access the WhatLinksHere (WLH) of a page.

  • Navigate to the page in question, then in the sidebar under Tools click WhatLinksHere
  • Navigate to the page in question, then press Alt+Shift+J or Ctrl+Option+J if using a Mac
  • Go directly to Special:WhatLinksHere and type an article name

When to use[edit | edit source]

  • Any time you are deleting an article, you should check its WLH and resolve all links.
  • If you are considering updating a template, you can check its WLH to find its uses and make sure your change won't break anything. You can also check how widely it's used; if more than 50 articles use it, or if a very important article uses it, you may want to test your change in a sandbox first.
  • If you are trying to improve navigation and discoverability of some pages, you can check what links there.
  • Maybe you want to add some of the pages from an article's WLH to a See also or Related articles section.

Advanced users - gadget improvement[edit | edit source]

You can add the following snippet to your personal JS to see totals of links and transclusions at the top of WLH pages, though you are bounded by your API max returned results limit, so this is more helpful for wiki admins / wiki guardians. This is not at all necessary for the page to be useful, and only should be used if it this section makes sense to you; otherwise ignore.

// See totals at the top of WLH pages
// Author: RheingoldRiver

$(function() {
	if (mw.config.get('wgCanonicalSpecialPageName') !== 'Whatlinkshere') return;
	var title = $('#mw-whatlinkshere-target').val();
	var ns = $('#namespace').val();
	title = title ? title : mw.config.get('wgTitle').replace('WhatLinksHere/', '');
	return new mw.Api().get({
		action : 'query',
		prop : 'linkshere|transcludedin',
		titles : title,
		lhlimit : 'max',
		tilimit : 'max',
		lhnamespace : ns == 'all' ? '' : ns,
		tinamespace : ns == 'all' ? '' : ns,
		
	}).then(function(data) {
		var lh, ti;
		for (p in data.query.pages) {
			var page = data.query.pages[p];
			lh = page.linkshere ? page.linkshere.length : 0;
			ti = page.transcludedin ? page.transcludedin.length : 0;
		}
		var display = [
			'Total links: ' + lh,
			'Total transclusions: ' + ti,
			'Redirects and links to redirects are NOT included!'
		];
		var el = document.createElement('div');
		$(el).html(display.join('<br>')).insertAfter($('#firstHeading'));
	});
});

See also[edit | edit source]

What links here on MediaWiki.org