Module:Word count/doc
Appearance
| This is a documentation subpage for Module:Word count. It may contain usage information, categories and other content that is not part of the original module page. |
| This module is rated as alpha. It is ready for limited use and third-party feedback. It may be used on a small number of pages, but should be monitored closely. Suggestions for new features or adjustments to input and output are welcome. |
| This module depends on the following other modules: |
| Description | This module implements {{Word count}}. |
|---|---|
| Status | Alpha |
| Updated | May 25, 2026 (2 months ago) |
| Dependencies | Module:Arguments |
This module implements {{Word count}}.
| This module uses TemplateStyles: |
Usage
Count the number of words in supplied text:
{{#invoke:Word count|main|Some text here}}
This will output the word count and display the supplied text.
Counting words on another page
To count the words on an existing page without displaying its contents, use the page parameter:
{{#invoke:Word count|main|page=Albert Einstein}}
When page is specified, the module outputs **only the word count** and does not display the page text.
Optional parameters
showcount- Set to
yesto display the word count. - When counting another page, the word count is shown by default.
limit- Sets a target or maximum word count.
- When provided, the output is styled to indicate whether the count is below, near, or above the limit.
trim- When used with supplied text, trims output to the specified word limit.
- This parameter has no effect when
pageis used.
prepend,append- Text to add before or after the displayed content.
- Ignored when
pageis used.
Notes
- The
pageparameter only works for pages on the local wiki. - The word count is based on the page’s wikitext, with common non-content elements (such as templates and references) excluded.
- This module does not expand templates when counting words.
Documentation
Package items
Word_count._main( str, limit )(function)- Main entry point for modules
- Parameters:
- Returns: table with necessary outputs
Word_count.main( frame )(function)- Entrypoint for template
- Parameters:
frameprocessing frame (table)frame.argsTemplate arguments (table)frame.args.pagePage mode (string)frame.args.limitWord count limit (string)frame.args.showcountwhether to show the word count (boolean)frame.args.trimWhether to trim at the word count limit (boolean)frame.args.unsubstWhether to convert substitutions into transclusions (boolean)frame.args.prependWhat to prepend prior to word limited section (string)frame.args.appendWhat to append after word limited section (string)
- Returns: Output wikitext (string)
Documentation above is auto generated