A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Page_naming below:

Manual:Page naming - MediaWiki

A page name refers to the title of a page within the wiki. The title appears at the top of the page content. Within the MediaWiki site, the page names are used to identify and link to different pages.

Page names are also case-sensitive, except for the first letter, which is always capitalized by default.

For example: Manual:Page naming is different from Manual: Page nAming

A page name may contain two parts:

Namespace:Title

For example, this page exists in the Manual namespace .

In a URL, spaces are allowed in page names and are automatically converted to underscores (_). For example, My Page becomes My_Page.

MediaWiki provides several magic words to handle and manipulate page names.

Returns the title of the current page.

Converts a page name to a form suitable for use in a URL by replacing spaces with underscores and encoding special characters.

Lists or extracts the namespace of a given page name.

Removes the namespace from a given page name and renders the page's title only.

Returns the base name of the page by removing the namespace and going up one level.

Returns the last part of the page name after the last slash.

Returns the namespace and title of the associated content page. This is similar to FULLPAGENAME.

Returns the namespace and title of the associated talk page.

A few things to note[edit]

Invalid page names - If the provided page name is invalid, these magic words return an empty string.

Maximum length - The maximum length for a page name without the namespace is 255 bytes. Exceeding this will return an empty string.

Interwiki prefixes - Some magic words behave differently if the input contains interwiki prefixes, which are not capitalized and handled according to the local settings of the wiki.

Namespace with colon only - A namespace followed by a colon without a page name is not considered a valid page name and returns an empty string.

These magic words help you manage and manipulate page names, making it easier to create dynamic and flexible wiki content.

Page title restrictions[edit]

When creating page titles in MediaWiki, there are specific restrictions and special cases to be aware of. This guide simplifies these rules to help you avoid issues.

Special characters[edit]

The following characters are not allowed in page titles (See Manual:$wgLegalTitleChars , deprecated):

 # < > [ ] | { }
Reasons for restrictions[edit]

These characters are prohibited because they have special meanings in MediaWiki syntax.

For example:

[[tc]] links to a page titled Tc, not [[tc]]. {{tc}} refers to Template:Tc, not {{tc}}. Testing page names[edit]

You can test if a page name is allowed by trying to create a link to it:

Write Gives Note [[a#b]] a#b links to anchor b on page a [[#b]] #b links to anchor b on the current page [[a|b]] b piped link to page a [[a%2f]] a/ %2f is a slash, so page names cannot contain slashes [[:/b]] /b prefix with a colon to link [[a_b]] a_b underscore and space are equivalent, but the underscore is displayed
[[a  b]]
a b no consecutive spaces in page names

Backslash (\):

May be converted to a forward slash (/) depending on context.

Forward slash (/):

It provides a special functionality in some namespaces.

To link to a page in the main namespace starting with /, use a colon: [[:/page]].

Namespace prefixes:

Page names cannot start with a generic namespace prefix. For example, an album titled Help: A Day in the Life in the English Wikipedia is called Help!: A Day in the Life to avoid being in help namespace.

Length limitations:

Maximum length: 255 bytes (excluding namespace prefix).

Non-ASCII characters may use up to 4 bytes each.

For example, this link tests the maximum page name length: 255 characters.

File namespace: 240 bytes for new uploads.

First character restrictions

Cannot be a colon (:), space ( ), or underscore (_).

Slashes (/) and percent signs (%) have special handling. For example, % followed by certain characters can cause issues (e.g., [[%23]] becomes #).

Understanding spaces vs. underscores in page names[edit]

When naming pages, a space and an underscore function the same way:

For example:

This means you don't need to worry about using spaces or underscores—they work interchangeably depending on where they appear.

Case-sensitivity in page names[edit] Namespace prefixes[edit] First character of the page name[edit] File name extensions[edit]

This means Stop_sign_us.jpg and Stop_sign_us.JPG are considered two different files.

By understanding these rules, you'll be better equipped to manage and navigate pages accurately!

Handling spaces and underscores in page names[edit]

When working with page names, it's important to know how spaces and underscores are treated.

Ignored spaces and underscores[edit]

Certain spaces and underscores are automatically ignored or treated as equivalent:

Pattern Example Before and after the page name
[[  Help  ]]</source>[[ Help ]]
|-
| Following a namespace prefix and before a colon
| <syntaxhighlight lang=mediawiki inline>[[Project :Help]]
Project :Help After the colon of a namespace prefix [[Project: Help]]Project: Help Duplicate consecutive spaces
[[Help:Talk   page]]
Help:Talk page Visible changes in link labels[edit]

In some cases, spaces and underscores may still appear in the link labels even if they are ignored in the actual page link:

Understanding URL encoding and page names[edit]

When creating a page name, certain characters are automatically converted to their corresponding characters. This is known as URL encoding. For example:

In other words, even though you might try to use %41 or %C3%80 as page names, they will be converted to A and À, respectively. This means that pages with these names will not be distinct— %41 will always be the same as A, and %C3%80 will always be the same as À. For example, if you create a page named À, its URL might look like http://mediawiki.org/wiki/%C3%80, but the actual page name will be À.

Canonical form of page names[edit]

When you reference a page using special tags, the system automatically formats the page name to a standard form called the "canonical form". Here's how it works:

A few examples:

Alphabetical sorting in page names[edit]

When organizing page names alphabetically, the system follows a specific order.


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4