Help:Self link

From Meta, a Wikimedia project coordination wiki

A self link is the use of a link code with the page itself as target. It does not produce an actual link, but a non-clickable bold text (the "self-link format"). However, with the preference setting "Underline links", this text is underlined. This can be suppressed putting the following in your relevant personal css page:

.mw-selflink { text-decoration: none !important; }

Live examples (hence depending on your settings):

Purpose[edit]

By itself, it is not useful to create bold text this way. However, the feature can be useful if, after expansion of any templates etc., the same wikitext is used on multiple pages and, depending on the page, it should produce a working link or just bold text. This applies, in particular, in the case of links in a template that is called on the various target pages.

Clickable self links[edit]

Notwithstanding the description above, there are some self links to which the self-link format does not apply.

Self link with full URL[edit]

Providing an external link with the full URL of the same page on which the link appears will give a standard, clickable link. For example, if you are viewing the master copy on Meta of this help page ([1]), then this is demonstrated here:

  • [http://meta.wikimedia.org/wiki/Help:Self_link] gives [2]

Indirect self link[edit]

An indirect self link is a link to a page that redirects back. In this case, the self-link format does not apply, even though it would be equally useful here.

Self link with interwiki project prefix[edit]

Also, when the prefix for the project itself is added (interwiki link style, but again linking to the page itself) the self-link format does not apply; if you are viewing the master copy on Meta of this help page then this is demonstrated here:

Self link to a section[edit]

See Help:Link#Anchors for more information on this.

For a link to a section of the same article, even from the same section, the self-link format does not apply:

The [[#top]] link is a convenient way to link back to the top of a long page, without leaving the reader confused about the link's purpose.

See also[edit]

Links to other help pages

Help contents
Meta · Wikinews · Wikipedia · Wikiquote · Wiktionary · Commons: · Wikidata · MediaWiki · Wikibooks · Wikisource · MediaWiki: Manual · Google
Versions of this help page (for other languages see further)
What links here on Meta or from Meta · Wikipedia · MediaWiki
Reading
Go · Search · Namespace · Page name · Section · Backlinks · Redirect · Category · Image page · Special pages · Printable version
Tracking changes
Recent changes (enhanced) | Related changes · Watching pages · Diff · Page history · Edit summary · User contributions · Minor edit · Patrolled edit
Logging in and preferences
Logging in · Preferences
Editing
Starting a new page · Advanced editing · Editing FAQ · Export · Import · Shortcuts · Edit conflict · Page size
Referencing
Links · URL · Piped links · Interwiki linking · Footnotes
Style and formatting
Wikitext examples · CSS · Reference card · HTML in wikitext · Formula · Lists · Table · Sorting · Colors · Images and file uploads
Fixing mistakes
Show preview · Reverting edits
Advanced functioning
Expansion · Template · Advanced templates · Parser function · Parameter default · Magic words · System message · Substitution · Array · Calculation · Transclusion
Others
Special characters · Renaming (moving) a page · Preparing a page for translation · Talk page · Signatures · Sandbox · Legal issues for editors
Other languages: