Template talk:No redirect

Latest comment: 2 months ago by 8rz in topic Edit request 3 April 2026

Why?

edit

Why is this easier than typing [[:page name|label]]? I'm not seeing where avoiding a redirect comes into it or is being avoided. —Largo Plazo (talk) 16:50, 4 February 2014 (UTC)Reply

To editor Largoplazo: There is more to it than the link as you have typed it above – [[:page name|label]]. When you click the edit link on the template page, you will see in the code that the full url is used to take the clicker directly to the redirect. There is no stopover at the target page with another link at the top to click. Instead, you can use this template. For example, instead of having to type:
  • [http://en.wikipedia.org/w/index.php?title=The_Silence_of_the_Sea&redirect=no ''The Silence of the Sea'']
you can type:
  • ''{{No redirect|The Silence of the Sea}}''
It gets even better when an alias is used, for example:
  • ''{{-r|The Silence of the Sea}}''
will also get you directly to the redirect page. Joys!  Paine Ellsworth CLIMAX! 05:51, 26 June 2014 (UTC)Reply

Does this template work?

edit

Hello,

I wonder if this template is even working. Calling this templates returns a very standard link in the form [[:{{{1}}}|{{{2}}}]], which is redirected when clicking on it, the opposite of the expected behaviour.

I wonder if getting rid of the #ifexist test in the beginning would solve the matter, after all, if the target doesn't exist, the produced link would be a red link in any case, so there would be little harm done.

For the purpose of testing:

  • {{#ifexist:2015 UK General election | Exists | Doesn't exist }} gets: Exists

Notice that the equivalent template on French Wikipedia, fr:Modèle:Noredirect, although coded slightly differently, works with the expected behaviour.

Can someone with editing privileges have a look into this? Place Clichy (talk) 16:43, 28 June 2015 (UTC)Reply

Not done: It's working as intended: your first example takes me to the redirect, not the ultimate page; it expands to
<span class="plainlinks">[//en.wikipedia.org/w/index.php?title=2015_UK_General_election&redirect=no 2015 UK General election]</span>
which is what I would expect. --Redrose64 (talk) 17:01, 28 June 2015 (UTC)Reply

Expensiveness

edit

On 14 August Jackmcbarn raised a deletion review regarding this template's TFD, with the concern that the redirect check made the template expensive (I only saw the DRV today). I considered that during the TFD, but it's not the case: the original template had had an #ifexist for years before the TFD. A separate non-expensive version could of course be created separately. SiBr4 (talk) 20:31, 6 September 2016 (UTC)Reply

Protected edit request on 12 October 2017

edit

Please sync the sandbox version, which prevents multi-colon errors. Ahecht (TALK
PAGE
) 19:17, 12 October 2017 (UTC)Reply

Done  Martin (MSGJ · talk) 21:12, 12 October 2017 (UTC)Reply
edit

I noticed a wee buggette (or undocumented feature) with this template: the default page title is put in initial case for things that are not redirects. For example

  • Blue redirect: {{-r|heroic}} heroic (not initial case)
  • Blue article: {{-r|hero}} hero
  • Red link: {{-r|heroinic}} heroinic

The optional text parameter always gets preserved verbatim, fortunately:

  • Blue redirect: {{-r|heroic|heroic}} heroic
  • Blue article: {{-r|hero|hero}} hero
  • Red link: {{-r|heroinic|heroinic}} heroinic

This is perhaps not particularly important as this template should rarely be transcluded by articles. But on discussion pages, it would perhaps be better to keep the text verbatim.

I imagine this is caused by the use of the FULLPAGENAME when isRedirect is false?

178.164.139.37 (talk) 11:20, 30 December 2018 (UTC)Reply

Echoing the above  maybe people have not understood the bug report  I consider the undocumented case change very annoying and improper. If I type "{{-r|lowercase}}" and "{{-r|heroic}}", I get what looks like "lowercase" and "Heroic"! This makes no sense, is undocumented, and will introduce errors. It will cause random improper uppercase words in the middle of sentences, and it is not obvious to the user that it will happen or how to avoid it or fix it. If someone provides a link name in lowercase, please let them use lowercase! As MOS:CAPS says, "Wikipedia avoids unnecessary capitalization." —⁠ ⁠BarrelProof (talk) 05:19, 3 June 2024 (UTC)Reply
I have removed the unnecessary usages of FULLPAGENAME in this edit. Consider this fixed after almost seven years. GTrang (talk) 17:23, 25 November 2025 (UTC)Reply
Thanks! That's great. —⁠ ⁠BarrelProof (talk) 17:51, 25 November 2025 (UTC)Reply
Unfortunately, my edit to the template has led to Anomalocaris reporting a lint error at Wikipedia talk:Linter#No redirect. My subsequent edit should hopefully fix both issues. GTrang (talk) 21:50, 25 November 2025 (UTC)Reply

Template-protected edit request on 8 July 2023

edit

Can somebody please add class mw-redirect to the link? I have CSS styling that makes redirects green, but links from this template look blue. QuickQuokka [⁠talkcontribs] 02:36, 8 July 2023 (UTC)Reply

Like this?  Martin (MSGJ · talk) 18:23, 8 July 2023 (UTC)Reply
@MSGJ: Nope. I think the class has to be in the <a> tag itself, otherwise it's still blue. --QuickQuokka [⁠talkcontribs] 18:32, 8 July 2023 (UTC)Reply
@MSGJ: USA Testing this URL --QuickQuokka [⁠talkcontribs] 18:35, 8 July 2023 (UTC)Reply
Please update the sandbox when you find the right solution  Martin (MSGJ · talk) 19:58, 8 July 2023 (UTC)Reply
 Not done: This actually cannot be done. It is a technical limitation. Izno (talk) 20:44, 9 July 2023 (UTC)Reply

Template-protected edit request on 27 June 2025

edit

The ifexists parser function no longer adds backlinks, thus this template should be modified to add these backlinks if using an external URL. See more information at Template talk:R avoided double redirect § Edit request 26 June 2025.

Line 1: Line 1:
{{safesubst:<noinclude/>#if: {{safesubst:<noinclude/>#invoke:Redirect|isRedirect|{{{1}}}}} {{safesubst:<noinclude/>#if: {{safesubst:<noinclude/>#invoke:Redirect|isRedirect|{{{1}}}}}
| <span class="plainlinks">[{{safesubst:<noinclude/>fullurl:{{{1}}}|redirect=no}} {{{2|{{{1}}}}}}]</span> | <span class="plainlinks">[{{safesubst:<noinclude/>fullurl:{{{1}}}|redirect=no}} {{{2|{{{1}}}}}}]</span><span style="display: none">[[:{{{1}}}]]</span>
| {{safesubst:<noinclude/>#if:{{{2|}}}|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}|{{{2}}}]]|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}]]}} | {{safesubst:<noinclude/>#if:{{{2|}}}|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}|{{{2}}}]]|[[:{{safesubst:<noinclude/>FULLPAGENAME:{{{1}}}}}]]}}
}}<noinclude> }}<noinclude>

~ Eejit43 (talk) 00:10, 27 June 2025 (UTC)Reply

 Completed. P.I. Ellsworth, ed. put'er there 18:04, 27 June 2025 (UTC)Reply
@Paine Ellsworth and Jonesey95: I had to revert this, as the combination of your two edits resulted in uses of the template to link to File-namespace titles showing up as file usages rather than links, which caused User:JJMC89 bot to misbehave. The edits probably also broke similarly for links to Category namespace titles. Ideally the WMF (or volunteer devs, if any) should finish T395366 to resolve this, but if you want to try again with the hack here please make sure it always produces page links rather than file usages or categorization. Thanks! Anomie 02:09, 21 July 2025 (UTC)Reply
@Jonesey95: Rather than removing the colon from the "invisible link" in Template:No redirect, you should have removed the colon after the two instances of {{no redirect| at Template:Singular and plural instead (reverting Godsy's latest edit) to fix the "Linter double-colon error" at Template:Singular and plural/doc. So, Paine Ellsworth's changes should be re-instated. GTrang (talk) 15:42, 8 August 2025 (UTC)Reply
I have gone back to Paine Ellsworth's version. Feel free to revert if it causes any problems. – Jonesey95 (talk) 22:13, 8 August 2025 (UTC)Reply

Edit request 3 April 2026

edit

Description of suggested change:

Add an optional parameter =nobrackets to suppress the oval square brackets [[ ]]. 8rz (talk) 21:18, 3 April 2026 (UTC)Reply

 Not done: it's not clear what you want to achieve. The edit request templates should be used only when the change is clear and the consensus for them is established. See Wikipedia:Edit requests#Planning a request.
Also, you say "oval brackets", but then show an example of square brackets. It seems that nobody calls any of the brackets "oval" – the closest one is round brackets. —⁠andrybak (talk) 23:23, 3 April 2026 (UTC)Reply
Meant to write square. I requested this change because was issuing a warning on a user page about vandalizing a redirect, where I added [[:[[:|<redirectname>]]]] which rendered the redirect title [[:redirectname>]] in the warning template. Couldn't find an option to toggle them off so I am posted this request for a custom parameter. 8rz (talk) 23:50, 3 April 2026 (UTC)Reply
I still fail to parse what is meant here. Examples of wikitext work better with <nowiki>...</nowiki> tags in addition to <code>. A concrete example (with a diff link) is always a good idea. —⁠andrybak (talk) 23:57, 3 April 2026 (UTC)Reply
While issuing {{subst:Uw-advert2{{!}}{{no redirect{{!}}H:S}}}} on User talk:~2026-14170-67 (no diffs, only 1 edit), I wanted to remove the [[ ]] rendered in the warning's message "Please do not add promotional material to Wikipedia, as you did to {{:H:S}}..." so it renders as "Please do not add promotional material to Wikipedia, as you did to H:S..." but didn't know how. 8rz (talk) 00:41, 4 April 2026 (UTC)Reply
8rz, the brackets in this case were produced by Template:Uw-advert2, not Template:No redirect. Template:Uw-advert2 expects a page name as its first positional parameter, not arbitrary input. The solution is to not use {{no redirect}} as a parameter to {{subst:Uw-advert2}}. —⁠andrybak (talk) 01:30, 4 April 2026 (UTC)Reply
...not use {{no redirect}} as a parameter to {{subst:Uw-advert2}}}}. Even if it means having to go back to the redirect page by clicking the link from the target page the redirect leads to (which is an extra step). {{no redirect}} did append the &redirect=no param to the end of the page url which inadvertently adds the square brackets in the UW, unfortunately. 8rz (talk) 02:06, 4 April 2026 (UTC)Reply
There is no edit we can make to this template for wikitext like [[:{{no redirect|H:S}}]] to do what you want. In current MediaWiki, avoiding the following of a redirect requires an external link, not an internal one as produced by the surrounding double square brackets. Anomie 12:22, 4 April 2026 (UTC)Reply
After doing some research, I realized the part in {{uw-advert2}}'s code: as you did to [[:{{{1}}}]]]], the positional param [[:{{{1}}}]]]]}} would need expanding with a conditional expression fullurl, #if, #ifeq, etc, to work. Filed a request on the UW template's talk page. 8rz (talk) 17:54, 4 April 2026 (UTC)Reply