User:V111P/js/What Links Here link filter
What Links Here link filter adds an additional filter on What Links Here pages allowing you to, in effect, exclude pages linking to the page through a given navigation template. This works, because navigation templates include a link to themselves in their top left conrner. (A script removing all pages transcluding a given template can also easily be created if it's needed.) Keep in mind that the removed pages may also include a link to the page outside of that template.
The script also adds a link allowing you to view up to 5000 pages at a time (next to the links for 20, 50, 100, 250, and 500 pages).
You can edit this page. If I don't like or understand something you wrote, I will correct it. ;)
Installation
Copy the following code to your common.js:
if (mw.config.get('wgCanonicalSpecialPageName') == 'Whatlinkshere')
importScript('User:V111P/js/whatLinksHereLinkFilter.js'); // [[User:V111P/js/whatLinksHereLinkFilter.js]]
How to use it
On the "What Links Here" special page:
- First you must enter a page name in the Page text input box, but that's prefilled for you if you went there through the "What links here" link in the Toolbar. For testing purposes, you can try for example Wichita Falls, Texas
- You may want to select Namespace: (Article) instead of the default all. Then press Go next to it, which should give you this result.
- Click the 5000 link to show a maximum of 5000 links on the page (this is the maximum allowed at the moment), which should give you this result.
- Finally, in the Filters section, next to the text Hide pages linking to:, enter a page name (most likely you want to enter a template name, in which case you need to include the Template: prefix as well) and press Go. The pages linking to that page will be removed from the list of links on the page. If your JavaScript console is open at the moment (try the F12 key) you will see how many links are being removed from the page and how many are remaining. You can repeat this step several times with different pages, or you can enter multiple pages in the field at the same time, just separate them with a vertical bar, for example:
Template:Texas|Template:Texas_counties
- If more than 5000 pages are linking to the page, click the "next 5,000" link and repeat steps 4 and 5 to see the remaining links.