Template talk:Redirect

Different hatnotes depending on what the user searched for
I've created a redirect for The Present Tense, which is the name of a song by Radiohead, pointing to A Moon Shaped Pool, the album it appears on. I think it might be a good idea to display a hatnote saying "for the grammatical tense, see Present tense", but I only want that to appear if the user arrived at A Moon Shaped Pool by searching for The Present Tense. Does that make sense? If so, is there a way to do it? Popcornduff (talk) 12:58, 16 December 2018 (UTC)

This makes sense. And it ties with the topic by Popcornfud. Hatnotes should only appear in the article if the user was redirected from a specific search term.--TZubiri (talk) 19:57, 30 June 2021 (UTC)
 * , wow, my original comment was 3 years ago. I recall there was some suggestion of this idea somewhere else at some point but it didn't get much discussion there either. A while ago I typed up some more thoughts on my userspace here but I didn't do anything with the idea. Disambiguation hatnotes still bother me. Popcornfud (talk) 21:22, 30 June 2021 (UTC)

That's great thanks! I added the essay and the example to Wikipedia_talk:WikiProject_Redirect where I am compiling examples of the problem and previous discussions on the subject. If you find or can think of any more resources, feel free to add them there! I'll do my best to get this fixed, it might take a while though!--TZubiri (talk) 21:44, 30 June 2021 (UTC)
 * , thanks. I'm not technical at all and I don't know anything about how you get this kind of thing changed on Wikipedia. Good luck! Popcornfud (talk) 22:02, 30 June 2021 (UTC)

Suggestion: display certain hatnotes only if the user has been redirected from certain targets
The Blue Album is an album by Weezer. It contains a song called "The World Has Turned and Left Me Here". There is also an episode of a TV show titled "The World Has Turned and Left Me Here".

If you go to the Blue Album article (Weezer (Blue Album)), it currently displays this hatnote: The World Has Turned and Left Me Here" redirects here. For the Vampire Diaries episode, see The World Has Turned and Left Me Here (The Vampire Diaries).

I think this hatnote should only be displayed if the user has searched for "The World Has Turned and Left Me Here" and been redirected to Weezer (Blue Album). My logic is this:


 * If you're redirected to the Blue Album article because you were looking for an article about the TV episode, the hatnote is useful. It tells you that you're in the wrong place and gives you a link to the right article.
 * If you arrive at the Blue Album article any other way, the hatnote isn't useful - you almost certainly don't care that there is an episode of a TV show with the same title as a song on this album. It's just clutter.

It would be great if there were a way to display certain hatnotes only if the user has been redirected from certain targets. Popcornfud (talk) 14:53, 11 April 2020 (UTC)
 * We can't do anything about that here - it requires a software change, for which you need to file a feature request at, see WP:Feature request. -- Red rose64 &#x1f339; (talk) 20:00, 11 April 2020 (UTC)
 * , I did in fact request it over there last year - see T232278.
 * I was told: this is not done by the MediaWiki software but by a local template on English WIkipedia, and closing this task as invalid as this is about changing on-wiki content of a wiki page, which needs to be discussed on that local wiki.
 * Any suggestions? Popcornfud (talk) 20:03, 11 April 2020 (UTC)
 * Either I misunderstood the request, or did. I suppose you could try WP:VPT. -- Red rose64 &#x1f339; (talk) 21:48, 11 April 2020 (UTC)
 * , I tried to clarify my understanding (which might be wrong) in T232278. HTH. :) --AKlapper (WMF) (talk) 09:23, 12 April 2020 (UTC)
 * , thanks again for the reply there.
 * However, I'm now kind of lost. I'm not technically minded enough to follow your reply at phab, and I see that the task there is still closed. All I want to do is lodge the suggestion. Is it now in its proper place? Should I ask at WP:VPT? Popcornfud (talk) 13:17, 12 April 2020 (UTC)
 * Either WP:VPT, or on the talk page of the template itself, I'd say. --AKlapper (WMF) (talk) 15:21, 12 April 2020 (UTC)
 * OK, thanks, I've tried at WP:VPT. Popcornfud (talk) 15:33, 12 April 2020 (UTC)
 * However, I'm now kind of lost. I'm not technically minded enough to follow your reply at phab, and I see that the task there is still closed. All I want to do is lodge the suggestion. Is it now in its proper place? Should I ask at WP:VPT? Popcornfud (talk) 13:17, 12 April 2020 (UTC)
 * Either WP:VPT, or on the talk page of the template itself, I'd say. --AKlapper (WMF) (talk) 15:21, 12 April 2020 (UTC)
 * OK, thanks, I've tried at WP:VPT. Popcornfud (talk) 15:33, 12 April 2020 (UTC)

I feel this is one of the most worthwile technical changes to implement, regardless of whether it is MediaWiki or En Wiki's responsiblity, let's try to find more iconic examples:

- Human body An article about the human anatomy, mentions a textbook called "Anatomy of the human body" even if one did not search that. If reached through other methods this hatnote should not appear. This presents a neutrality issue by immediately focusing on one of the many sources rather than the one subject.

--TZubiri (talk) 22:50, 29 June 2021 (UTC)
 * Anatomy of the Human Body does redirect to the textbook. 20 pageviews in the past year. Gray's Anatomy links to human body in the lead sentence.
 * The generic form Anatomy of the human body has 105 pageviews in the last year.
 * Human body has 798,423 pageviews in the past year.
 * So the implicit rationale is that those searching for the book will take the time to use their shift keys or select the uppercase option from the search drop-down and those searching for the lowercase term are predominantly looking for the broad-concept article which is the primary topic and inconveniencing those <100 readers/year that search on "anatomy of" by sending them to the book and making them click on the link in the lead sentence to get back to the article they really want to see is just unacceptable, but annoying some 798,000 readers/year with this hatnote is an acceptable compromise in order to avoid the inconvenience of forcing some subset of 105 readers to make an extra mouseclick to get where they want to go. You could bring this up at WP:Redirects for discussion.
 * Don't hold your breath waiting for a technical solution. – wbm1058 (talk) 00:56, 30 June 2021 (UTC)


 * Thank you for the analysis! I might take this opportunity to delve into WikiMedia development, so if the problem is merely technical I would try to fix this myself, I just want to make sure that the community is on board and to gather the appropriate historical consensus and a good list of cases before bringing it up to the development team.--TZubiri (talk) 19:53, 30 June 2021 (UTC)

Maintenance category for excessive links
Would it be possible (or a good idea) for this template to put pages into a maintenance category if it includes more than a certain number of links, for example Category:Hatnotes with more than three linked pages? In cases like that, you really should be creating a disambiguation page, so if this template could put pages in such a category, it would help us find pages that need one. Oiyarbepsy (talk) 06:12, 24 April 2021 (UTC)

Documentation and example
Hi all. I have two requests: for the usage in an example, and for improving the documentation. Can someone let me know which template would be appropriate for National World War I Museum and Memorial? Is that article's requirement too complicated for this template? Part of the reason for asking is that the documentation for this template is incomprehensible, even while testing it in preview. The example lists several numerical arguments like "1=" but the explanations are perfectly obtuse, recursive, and meaningless. Could someone please elaborate there, even with a few more words? Thank you. — Smuckola(talk) 22:53, 15 August 2021 (UTC)
 * The template should never be as complex as the current version of the hatnote at that article would require. The hatnote is simply way too long. First and foremost, Liberty Memorial should probably be a disambiguation page. Other memorials can be covered by linking to List of World War I monuments and memorials. A link to those two should be all that is included. I'll start working on that later today. Oiyarbepsy (talk) 23:58, 15 August 2021 (UTC)
 * the right template for that article would be Redirect2 (and for even more complicated scenarios, either redirect-multi or redirect-several can be used). – Uanfala (talk) 12:06, 18 August 2021 (UTC)

"See Wiktionary" template
I've added a mention of See Wiktionary with its "redirect" parameter, as this creates a hatnote like
 * ""Foo" redirects here. For a definition of the term "Foo", see the Wiktionary entry Foo.",

which looks like the output from this template, and will be of use to some editors who come to this template's documentation page hoping to make such a redirect. (In my case I wanted to replace the Wiktionary redirect at SMIDSY after retargetting it to Beryl (company): see discussion at Wikipedia_talk:WikiProject_Redirect) Pam  D  07:36, 19 July 2022 (UTC)

Unneeded linking
When using this template, I don't think that given redirects should actually be "linked" to. This causes many issues such as if the redirect is tagged as misspelling (such as OB1, ), when it really isn't linking to that page. ~ Eejit43 ( talk ) 18:26, 28 December 2022 (UTC)
 * misspellings and miscapitalizations should not be seen in hatnotes. Preference should always be given to targeting the correct spelling.
 * retarget to the correct destination
 * remove the hatnote
 * Problem solved. – wbm1058 (talk) 04:54, 30 December 2022 (UTC)
 * Easy enough, thanks! ~ Eejit43 ( talk ) 13:03, 30 December 2022 (UTC)

linking of the original redirected term for use with section redirects
Cf. Village_pump_(idea_lab). --Joy (talk) 11:43, 3 July 2023 (UTC)

Selfref parameter
Unlike for, redirect has no support for a self reference parameter. I believe that would be a useful feature in some cases like (this example happens to use redirect2). Nickps (talk) 11:39, 6 April 2024 (UTC)

Template-protected edit request on 10 April 2024
Since no one objected above, I'm now asking that a selfref parameter be added to this template, analogous to the one for has. Nickps (talk) 19:28, 10 April 2024 (UTC)
 * Red information icon with gradient background.svg Not done: selfref is already implemented. See the testcases for it in action. SWinxy (talk) 21:20, 10 April 2024 (UTC)
 * I guess I should have done better due diligence. Thanks for updating the docs. Nickps (talk) 22:43, 10 April 2024 (UTC)

Template inject blank paragraph
In certain cases this template would inject  in content, which have no text in it. How to fix that? See this screenshot. -- Great Brightstar (talk) 19:32, 4 June 2024 (UTC)
 * The reason of this problem is found out. Stack begin have something missing that affect mobile frontend. -- Great Brightstar (talk) 15:19, 6 June 2024 (UTC)