Template talk:Redirect

Page contents not supported in other languages.
From Wikipedia, the free encyclopedia
WikiProject iconRedirect Template‑class
WikiProject iconThis page is within the scope of WikiProject Redirect, a collaborative effort to improve the standard of redirects and their categorization on Wikipedia. If you would like to participate, please visit the project page, where you can join the discussion and see a list of open tasks.
Note: This banner should be placed on the talk pages of project, template and category pages that exist and operate to maintain redirects.
This banner is not designed to be placed on the talk pages of most redirects and almost never on the talk pages of mainspace redirects. For more information see the template documentation.
TemplateThis template does not require a rating on Wikipedia's content assessment scale.

Different hatnotes depending on what the user searched for[edit]

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)[reply]

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)[reply]

TZubiri, 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)[reply]

That's great thanks! I added the essay and the example to Wikipedia_talk:WikiProject_Redirect#Displaying_hatnote_redirects_only_when_redirected. 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)[reply]

TZubiri, 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)[reply]

Custom link text[edit]

In Volutaria I wanted to italicize (un-italicize) a genus name that has parenthetical disambiguation, as is possible in {{for2}}. It would look something like this: {{redirect|Cyanopsis|the genus of [[tachina flies]]|[[Cyanopsis (fly)|''Cyanopsis'' (fly)]]}}. But that doesn't work. Is there a template that allows this? I didn't spot one in the table of hatnote templates. — Eru·tuon 00:51, 26 June 2019 (UTC)[reply]

Maybe {{redirect|Cyanopsis|text=For the genus of [[tachina flies]], see [[Cyanopsis (fly){{!}}''Cyanopsis'' (fly)]]}}? If I remember correctly, this used to be the function of Template:Redirect3, before it got deleted last year, along with a few other similar templates; the intention of those deletions was to simplify the system of hatnotes, but because they were done in a fragmentary way ended up making it more complicated. So now, for some template you'll have to use the |text= parameter, and for others you'll have to go for the sister template ending in "2". – Uanfala (talk) 01:17, 26 June 2019 (UTC)[reply]
Ohh, that gives me an idea, which I've inserted into the article: {{redirect|Cyanopsis|the genus of [[tachina flies]]|Cyanopsis (fly){{!}}''Cyanopsis'' (fly)}}. I guess that works. The same technique could be used in {{for}} to render {{for2}} obsolete ({{for2|the genus of [[tachina flies]]|[[Cyanopsis (fly)|''Cyanopsis'' (fly)]]}}{{for|the genus of [[tachina flies]]|Cyanopsis (fly){{!}}''Cyanopsis'' (fly)}}). — Eru·tuon 01:48, 26 June 2019 (UTC)[reply]
Ah, yes, that's even better. That doesn't render the other templates obsolete though, as it won't work if you need to add text before or after the link. On an unrelated note, Cyanopsis (fly) is a red link; why would you link to it from a hatnote? – Uanfala (talk) 11:50, 26 June 2019 (UTC)[reply]
I saw that convention with Pallenis, so I figured it might be the thing to do when a plant genus (or synonym of one) and an animal genus without an article share the same name. It's sort of in the vein of adding likely redlinks in text (WP:RED). But I haven't really looked into the policy on this. — Eru·tuon 14:54, 26 June 2019 (UTC)[reply]
Regarding the links to tachina flies, please see WP:HATEXTRA. --Redrose64 🌹 (talk) 15:18, 26 June 2019 (UTC)[reply]
Thanks. I simplified the hatnotes. — Eru·tuon 15:41, 26 June 2019 (UTC)[reply]
A hatnote with extraneous links is suboptimal, but a hatnote without any blue links at all (WP:REDHAT) is completely useless. – Uanfala (talk) 21:32, 26 June 2019 (UTC)[reply]
@Uanfala: I suppose. If you have any idea what is usually done in cases like this, please let me know. I may look for a WikiProject to ask about this. — Eru·tuon 23:41, 26 June 2019 (UTC)[reply]
Oh, you removed the redirect and created a disambiguation page. That works. I suppose a similar thing could be done with Pallenis. — Eru·tuon 23:46, 26 June 2019 (UTC)[reply]
The talk page of WP:HATNOTE is usually a good place to ask. As for Pallenis, it's the actual title of the article (rather than an obscure redirect from a synonym) and the incoming links suggest it's best to treat it at least for now as a primary topic. So renaming the article and creating a dab page is not on the table. There are three options for the hatnote: either 1) turn the red link blue (making Pallenis (beetle) a redirect to Cleridae, where it's mentioned (not great given the WP:REDLINK incentive for creation of an article and the general preference against redirecting to higher-level taxa), or 2) mention the article directly in the hatnote ("This article is about the plant genus. Pallenis is also the name of a genus of checkered beetles."), or 3) remove the hatnote altogether. – Uanfala (talk) 02:10, 27 June 2019 (UTC)[reply]

Suggestion: display certain hatnotes only if the user has been redirected from certain targets[edit]

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)[reply]

@Popcornfud: We can't do anything about that here - it requires a software change, for which you need to file a feature request at phab:, see WP:Feature request. --Redrose64 🌹 (talk) 20:00, 11 April 2020 (UTC)[reply]
Redrose64, I did in fact request it over there last year - see phabricator: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)[reply]
Either I misunderstood the request, or AKlapper (WMF) (talk · contribs) did. I suppose you could try WP:VPT. --Redrose64 🌹 (talk) 21:48, 11 April 2020 (UTC)[reply]
Redrose64, I tried to clarify my understanding (which might be wrong) in phab:T232278#6049864. HTH. :) --AKlapper (WMF) (talk) 09:23, 12 April 2020 (UTC)[reply]
AKlapper (WMF), 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)[reply]
Redrose64 Either WP:VPT, or on the talk page of the template itself, I'd say. --AKlapper (WMF) (talk) 15:21, 12 April 2020 (UTC)[reply]
OK, thanks, I've tried at WP:VPT. Popcornfud (talk) 15:33, 12 April 2020 (UTC)[reply]

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)[reply]

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)[reply]
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)[reply]

Parameter "distinguish"?[edit]

Occasionally I would find myself having to create a hanote like this:

"REDIRECT" redirects here. For USE1, see PAGE1. Not to be confused with PAGE2.

One way that I'm able to do that currently, is by writing out the second part by hand into the |text= parameter like that: {{Redirect|REDIRECT|USE1|PAGE1|text=Not to be confused with [[PAGE2]]}}. The alternative – having two separate hatnotes, each on a new line, is not desirable because in this example, PAGE2 is something that can specifically be confused with the title of the redirect, not the title of the article. And I'm not keen on using a third wrapper template to combine the two hatnotes into one.

Wouldn't it be nice if {{Redirect}} had a |distinguish= parameter, so that the desired hatnote could be accomplished by {{Redirect|REDIRECT|USE1|PAGE1|distinguish=PAGE2}}? – Uanfala (talk) 23:51, 17 April 2020 (UTC)[reply]

{{Redirect-distinguish6}} supports that, though it puts the distinguish message first and doesn't support multiple uses. --Pokechu22 (talk) 05:54, 9 June 2020 (UTC)[reply]

Maintenance category for excessive links[edit]

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)[reply]

Documentation and example[edit]

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)[reply]

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)[reply]
@Smuckola: 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)[reply]

"See Wiktionary" template[edit]

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#Hatnote_for_a_Wiktionary_redirect?) PamD 07:36, 19 July 2022 (UTC)[reply]

Unneeded linking[edit]

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, Pages that link to "OB1"), when it really isn't linking to that page. ~ Eejit43 (talk) 18:26, 28 December 2022 (UTC)[reply]

@Eejit43: misspellings and miscapitalizations should not be seen in hatnotes. Preference should always be given to targeting the correct spelling.
  1. retarget to the correct destination
  2. remove the hatnote
Problem solved. – wbm1058 (talk) 04:54, 30 December 2022 (UTC)[reply]
Easy enough, thanks! ~ Eejit43 (talk) 13:03, 30 December 2022 (UTC)[reply]

linking of the original redirected term for use with section redirects[edit]

Cf. Wikipedia:Village_pump_(idea_lab)#Redirect_hatnote_link. --Joy (talk) 11:43, 3 July 2023 (UTC)[reply]

Selfref parameter[edit]

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

Template-protected edit request on 10 April 2024[edit]

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)[reply]

 Not done: |selfref= is already implemented. See the testcases for it in action. SWinxy (talk) 21:20, 10 April 2024 (UTC)[reply]
I guess I should have done better due diligence. Thanks for updating the docs. Nickps (talk) 22:43, 10 April 2024 (UTC)[reply]