Manual:Article count

The article count is the number of content pages on a wiki. It is available from the wiki's stat>Special:Statistics|Special:Statistics page and from the   mw>Special:MyLanguage/Help:Magic words|magic word.

By default, a page is counted as an article when:
 * it's in the main ns>Special:MyLanguage/Help:Namespace|namespace (meaning its title doesn't have a prefix like "User:" or "Talk:")
 * it contains at least one internal link ((e.g. the text " Main Page " creates a wikilink to the page titled "Main Page")
 * it isn't a redir>Special:MyLanguage/Manual:Redirects|redirect.

Which namespaces are used can be controlled by .

Before this count was used, an article was counted if it contained at least one comma.

That method proved to be unreliable in many languages where the comma does not have much or any significance (see Article count reform for the process which led to this outcome).

However, the comma count is still common in the wiki world; see, e.g., BiggestWiki.

Changing the MediaWiki article count settings
Before , the method used to count articles was determined by the configuration variable  which was at the same time deprecated and later removed in .

Since 1.18, the variable <tvar|ArticleCountMethod></> is used.

In <tvar|DefaultSettings></>, the default setting for <tvar|ArticleCountMethod></> is "link", which means <tvar|num> </> counts all pages in the main name namespace that are not a redirect and meta>meta:Article count reform</>|contain at least one wiki link.

This includes stubs containing a link, and disambiguation pages.

In recent versions of MediaWiki, the existence of links is checked by consulting the database table, so it includes links provided by the transclusion of templates or other pages. Special links such as category links (which place pages into categories) and file links (which display files) do not count when determining the article status of a page, because those links affect different database tables.

To change to a different method, use one of the following approaches:

MW 1.18 and after

 * Define the article count method with the variable <tvar|ArticleCountMethod></>.

MW 1.17 and before

 * If you want to count articles only if they contain a comma, you can set the variable <tvar|UseCommaCount></> to <tvar|true> </> in <tvar|LocalSettings></>.

Updating article count statistics
If you want to recount your wiki to reflect a change in article count method (that does not happen automatically), run <tvar|updateArticleCount></> from a command line.

If you only have access to the database you can get an approximation to the article count by using a query similar to the following, which only checks page links (similar to the "link" method):