Current Situation
The interface message MediaWiki:Longpage-hint exists in MediaWiki but is rarely used in practice. Most MediaWiki installations — including Wikimedia wikis — leave it undefined. When it *is* defined, it produces confusing and undesirable behavior:
- If the message exists and is not empty, MediaWiki displays a “long page” warning for every page edit, regardless of how large or small the page actually is.
- Users tend to ignore warnings if they are repeatedly presented with them when they are not required.
- Parser functions can be used to show the message conditionally, but those are not part of MediaWiki core, and this solution is hackish.
- When section-editing, the message returns the size of the *section* when it's the size of the *page* that’s important. This means that the parser function hack doesn't work while section editing. (T50719: Issues related to section editing (tracking) is vaguely relevant.)
In effect, this message acts as a logic switch disguised as an interface message — if defined, it suddenly activates a warning mechanism that cannot be configured or localized properly. This violates the principle that interface messages should control *presentation*, not *behavior*.
The feature’s current state is half-implemented and misleading, and contributes to Technical-Debt.
Proposal: Implement Conditional Long Page Warning in Core
Introduce a properly designed system that determines when to show a “long page” notice, based on actual page size relative to $wgMaxArticleSize.
Core configuration:
- $wgLongPageInfoThreshold: suggest default 0.75 (75%) — display a grey “information” notice indicating that the page is large.
- $wgLongPageWarningThreshold: suggest default 0.90 (90%) — display a yellow “warning” notice indicating the page is nearing the size limit.
- For section edits, evaluate the entire page size, not just the section being edited.
The warning text should live in new, clearly named and purpose-driven messages, such as:
MediaWiki:page-size-large-info:
“This page is rather large ({{formatnum:$1}} bytes — {{formatnum:$3}}% of the maximum ({{formatnum:$2}} bytes). Consider splitting or trimming content.
MediaWiki:Page-size-large-warning:
“Warning: This page is very large ({{formatnum:$1}} bytes — {{formatnum:$3}}% of the maximum ({{formatnum:$2}} bytes). Increasing the page size may cause it to exceed the limit. Please split or trim content.”
These example messages use $1 for the current article size and $2 for $wgMaxArticleSize (or its runtime value), and $3 for the percentage size.
Note, there is a remotely possible scenario where $wgMaxArticleSize has been reduced for some reason, and a saved page that was below the previous permissable limit is now longer than the current limit. We might have to think about how to cover this possibility.
Why This Matters
MediaWiki core should be self-contained, predictable, and reliable — it should work correctly out of the box without relying on local customizations or bundled extensions.
When a system message like MediaWiki:Longpage-hint affects program logic rather than just text display, it is not well-designed.
By refactoring this feature into proper conditional core logic, MediaWiki can:
- Provide relevant, data-driven info/warnings only when necessary.
- Preserve freedom for sites to customize text and thresholds through configuration, not fragile parser workarounds.
- Reduce confusion arising from hidden “magic” behaviour triggered by defining a message.
- Align with best practices where interface messages handle *content*, and *rules* live in core code.
