编辑入门:修订间差异

来自TUCMandWSC
跳转到导航 跳转到搜索
Tucmoffical留言 | 贡献
创建页面,内容为“== 入门 == * [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Configuration_settings MediaWiki配置设置列表] * [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:FAQ/zh-hans MediaWiki常见问题] * [https://lists.wikimedia.org/postorius/lists/mediawiki-announce.lists.wikimedia.org/ MediaWiki发布邮件列表] * [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources 本地化MediaWiki到您的语言] * [htt…”
 
Ruqiehou留言 | 贡献
 
(未显示2个用户的7个中间版本)
第5行: 第5行:
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources 本地化MediaWiki到您的语言]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Localisation#Translation_resources 本地化MediaWiki到您的语言]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam 了解如何在您的wiki上打击破坏]
* [https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Combating_spam 了解如何在您的wiki上打击破坏]
==The basics== <!--T:1-->
===What are the differences between MediaWiki, Wikimedia, Wikipedia, and wiki?=== <!--T:2-->
<!--T:3-->
Please see <tvar name=1>{{ll|Differences between Wikipedia, Wikimedia, MediaWiki, and wiki}}</tvar> for a detailed answer.
=== I want to use a MediaWiki instance to (blank). Am I allowed to? === <!--T:4-->
</translate>
<translate><!--T:5--> MediaWiki is free software: this means that you may use it for any purpose without legal hindrance.</translate>
<translate><!--T:6--> Furthermore, its licensing conditions apply solely to the software itself.</translate>
<translate><!--T:7--> This means that although many wikis license their content under a permissive license, you are not obliged to license the content submitted to your wiki in any particular way.</translate>
<translate><!--T:8--> Of course, as a project founded to support sites like Wikipedia, we encourage you to license the texts you write under a free license, but, in short, you are not required to.</translate>
<translate><!--T:9--> If you wish to alter or amend the software itself, in general, you are permitted to, but there are some restrictions and you should consult [<tvar name=url>http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</tvar> the full text of the GNU GPL version 2 for details].</translate>
<translate><!--T:10--> Because MediaWiki is provided free of charge, there is no warranty, to the extent permitted by applicable law.</translate>
<translate>
=== How do I create a wiki? === <!--T:754-->
</translate>
<translate><!--T:755--> Creating a wiki implies installing MediaWiki on a server and having access to manage it.</translate>
<translate><!--T:756--> There are different options, depending on your level of expertise:</translate>
* <translate><!--T:757--> To create a wiki on your own server, follow the [[<tvar name=1>Special:MyLanguage/Manual:Installation guide</tvar>|Installation guide]].</translate>
* <translate><!--T:758--> Some hosts offer one-click installs, or allow creating a wiki on-request.</translate> <translate><!--T:759--> See [[<tvar name=1>Special:MyLanguage/Hosting services</tvar>|Hosting services]] for different options.</translate>
<translate><!--T:760--> This site (MediaWiki.org) or the Wikimedia Foundation does not allow individuals to create wikis.</translate>
{{anchor|installation}}
<translate>
==Installation and configuration== <!--T:11-->
===Where do I download MediaWiki?=== <!--T:12-->
</translate>
<translate><!--T:13--> [[<tvar name=1>Special:MyLanguage/Download</tvar>|Download the latest stable release of MediaWiki.]] Files are supplied in a [[w:Tar (computing)|.tar]][[:en:gzip|.gz]] archive.</translate>
<translate><!--T:14--> MediaWiki can also be [[<tvar name=1>Special:MyLanguage/Download from Git</tvar>|obtained directly from our Git]] repository.</translate>
<translate>
===How to install MediaWiki?=== <!--T:15-->
</translate>
<translate><!--T:16--> Installing MediaWiki takes around 10 to 30 minutes, and involves uploading/copying files, and running the installer script to configure the software.</translate> 
<translate><!--T:17--> See <tvar name=1>{{ll|Manual:Installation guide}}</tvar>, where you will also find the ''minimum system requirements''.</translate>
<translate>
===How do I install MediaWiki using a package?=== <!--T:18-->
</translate>
<translate><!--T:19--> Many Linux distributions provide MediaWiki in a packaged format for that distribution.</translate>
<translate><!--T:20--> The MediaWiki development team refers you to your Linux distribution for assistance with installing, configuring or using them.</translate>
<translate><!--T:21--> The individual communities and companies who maintain such packages should provide installation instructions.</translate>
<translate><!--T:22--> Be warned that third-party distributions may be older versions, so pay close attention to compatibility information for directions and extensions.</translate>
:''<translate><!--T:664--> See also:</translate> {{ll|Software bundles}}''
<translate>
===Can I install more than one wiki on a server using MediaWiki?=== <!--T:24-->
<!--T:25-->
It is possible to install more than one wiki on a server provided that:
<!--T:693-->
* You install multiple instances of MediaWiki (such as with a [[<tvar name=1>Special:MyLanguage/software bundles#MediaWiki pre-integrated with AMP packages</tvar>|software bundle]] like the Bitnami MediaWiki Stack); in different directories &ndash; one for each wiki
<!--T:694-->
Or
<!--T:26-->
*You use a different database for each wiki
<!--T:27-->
Or
<!--T:28-->
*You use a different database prefix for each wiki (for Postgres, you can achieve a similar effect by using different schemas and users).</translate> <translate><!--T:782--> If you want to use the same <tvar name=1><code>LocalSettings.php</code></tvar> file for both, you must ensure <tvar name=2>$wgServer</tvar> is dynamically set to the correct value.</translate>
<translate>
<!--T:29-->
For information on the latter two options, see <tvar name=1>'''{{ll|Manual:$wgDBname|$wgDBname}}'''</tvar> and <tvar name=2>'''{{ll|Manual:$wgDBprefix|$wgDBprefix}}'''</tvar> respectively.
<!--T:30-->
For more information on setting up a wiki family (wikifarm), see <tvar name=1>{{ll|Manual:Wiki family}}</tvar>.
===How do I install an existing wiki, like Wikipedia or Wiktionary?=== <!--T:695-->
<!--T:696-->
The main (but not necessarily the easiest) method is to import. ''See [[<tvar name=1>#Wiki importing</tvar>|Wiki importing]], below.''
<!--T:698-->
(Non-MediaWiki methods, such as Xowa and Kiwix can be found at [[w:Wikipedia:Database download]]).
===Does MediaWiki require shell access?=== <!--T:35-->
</translate>
<translate><!--T:36--> Shell access ([[w:Secure Shell|SSH]]) is not required for installing MediaWiki, but it is ''highly recommended''.</translate>
<translate><!--T:37--> Without shell access, it may even be difficult for you to get a backup of your wiki, or to upgrade to a new version.</translate>
<translate><!--T:38--> Some maintenance tasks are not possible at all without shell access.</translate>
<translate><!--T:39--> Many major extensions work best with shell access.</translate>
<translate>
===How do I install extensions?=== <!--T:40-->
</translate>
<translate><!--T:41--> See <tvar name=1>{{ll|Manual:Extensions}}</tvar> for information about installing and writing extensions.</translate>
<translate><!--T:42--> See <tvar name=1>{{ll|Category:Extensions}}</tvar> to find existing extensions.</translate>
<translate>
===How do I add extra namespaces?=== <!--T:43-->
<!--T:44-->
See [[<tvar name=1>Special:MyLanguage/Manual:Using custom namespaces#Creating a custom namespace</tvar>|Creating a custom namespace]].
===How do I enable uploading?=== <!--T:45-->
</translate>
<translate><!--T:46--> File uploads are an often-used feature of MediaWiki, but are disabled by default in all current release versions.</translate>
<translate><!--T:47--> To enable them, first make the upload directory (default <tvar name=1><code>images</code></tvar>) writable by the web server (<code>[[w:chmod|chmod]] -R 777 ./images</code> or allow the Apache user to write to it, etc.) then set <tvar name=2>'''{{ll|Manual:$wgEnableUploads|$wgEnableUploads}}'''</tvar> to <tvar name=3><code>true</code></tvar> in <tvar name=4><code>LocalSettings.php</code></tvar>.</translate>
<translate><!--T:48--> If you get a "failed to mkdir" error when you try to upload, it probably means that there's a permissions problem.</translate>
:''<translate><!--T:665--> See also:</translate> {{ll|Manual:Configuring file uploads}}''
<translate>
===How do I allow uploading of additional formats?=== <!--T:65-->
</translate>
<translate><!--T:66--> MediaWiki requires that allowed file upload formats are specified using the <tvar name=1>'''{{ll|Manual:$wgFileExtensions|$wgFileExtensions}}'''</tvar> configuration directive.</translate>
<translate><!--T:67--> Usually this directive is situated in <tvar name=1><code>LocalSettings.php</code></tvar> in the root of your MediaWiki installation.</translate>
<translate><!--T:68--> For example, to extend uploading to PDF files, add the following to <tvar name=1><code>LocalSettings.php</code></tvar>:</translate>
<syntaxhighlight lang="php">
$wgFileExtensions[] = 'pdf';
</syntaxhighlight>
<translate><!--T:69--> To extend uploading to more than one type of file, use the following syntax</translate>
<syntaxhighlight lang="php">
$wgFileExtensions = array_merge( $wgFileExtensions, [ 'pdf', 'txt', 'mp3' ] );
</syntaxhighlight>
:''<translate><!--T:667--> See also:</translate> {{ll|Manual:Configuring file uploads}}''
<translate>
===How do I enable embedded math formulas?=== <!--T:50-->
</translate>
<translate><!--T:51--> MediaWiki allows embedded math formulas.</translate>
<translate><!--T:52--> See <tvar name=1>{{ll|Extension:Math}}</tvar> for complete setup instructions.</translate>
<translate>
=== How do I set the timezone for my MediaWiki? === <!--T:53-->
</translate>
:''<translate><!--T:54--> See <tvar name=1>{{ll|Manual:Timezone}}</tvar></translate>''
<translate>
===How do I purge a cached page?=== <!--T:55-->
<!--T:56-->
To purge a cached page, such as when making changes to the navigation bar, add <tvar name=1><code>&action=purge</code></tvar> to the end of the page's dynamic URL.
</translate>
<translate><!--T:57--> E.g.</translate>
https://www.mediawiki.org/w/index.php?title=Main_Page&action=purge
<translate><!--T:58--> Or <tvar name=1><code>?action=purge</code></tvar> to the end of the page's short form URL:</translate>
<translate><!--T:59--> E.g.</translate>
https://www.mediawiki.org/wiki/Main_Page?action=purge
:''<translate><!--T:666--> See also:</translate> {{ll|Manual:Purge}}, {{ll|Manual:Parameters to index.php}}''
<translate>
=== How do I completely disable caching? === <!--T:61-->
<!--T:62-->
Add in your <tvar name=1><code>LocalSettings.php</code></tvar> file the following lines:
</translate>
<code class="mw-code mw-highlight" style="display:block"><!--
-->{{ll|Manual:$wgParserCacheType|$wgParserCacheType}} = CACHE_NONE;
{{ll|Manual:$wgCachePages|$wgCachePages}} = {{#tag:span|false|class=k}};
</code>
<translate>
==="File is corrupt or has an invalid extension"=== <!--T:71-->
</translate>
<translate><!--T:72--> Some users have reported that after adding a file format to the allowed extensions list, an error is encountered.</translate>
<translate><!--T:73--> The text of the error is similar to the following:</translate>
:<translate><!--T:74--> ''The file is corrupt or has an incorrect extension. Please check the file and upload again.''</translate>
<translate>
<!--T:76-->
As a possible solution, set the value of <tvar name=1>'''{{ll|Manual:$wgMimeDetectorCommand|$wgMimeDetectorCommand}}'''</tvar>. Under Unix or Linux, this would be</translate> <syntaxhighlight lang="php">$wgMimeDetectorCommand = "file --brief --mime";</syntaxhighlight>
:''<translate><!--T:79--> See also:</translate> {{ll|Manual:MIME type detection}}''
{{anchor|Initial user was not created by installer}}
<translate>
===Initial user was not created by installer or it is not an administrator=== <!--T:80-->
</translate>
<translate><!--T:82--> Sometimes, the installer fails to create the default user, or the <tvar name=1><code>user</code></tvar> table is lost for some reason.</translate>
<translate><!--T:83--> There are a couple of options for solving this:</translate>
====maintenance/createAndPromote.php====
<translate>
<!--T:86-->
*Execute {{<tvar name=1>tmpl|0=<code>{{ll|Manual:createAndPromote.php|maintenance/createAndPromote.php}} --username &lt;$1> --password &lt;$2></code></tvar>|new user name|password for that user}} from the shell.</translate> <translate><!--T:87--> Append <tvar name=1><code>--bureaucrat</code></tvar> to command line if you want that user to become a bureaucrat, in addition to becoming an administrator.</translate>
<translate><!--T:88--> This will create a new user and promote them to an administrator.</translate>
<translate><!--T:89--> For help, run the script with the parameter <tvar name=1><code>--help</code></tvar>.</translate>
<translate>
====Alter the database==== <!--T:90-->
<!--T:91-->
*Register a new account using the regular method (<tvar name=1>[[Special:UserLogin]]</tvar>).</translate>
<translate>
<!--T:92-->
*Check the user ID [[<tvar name=1>Special:MyLanguage/API:Userinfo#Example</tvar>|via API]].</translate>
<translate>
<!--T:93-->
*Execute the following SQL statement against the database:</translate>
**<code>INSERT INTO user_groups ( ug_user, ug_group ) VALUES ( ''&lt;id>'', 'bureaucrat' ), ( ''&lt;id>'', 'sysop' );</code>
::<translate><!--T:94--> <tvar name=1><code>''&lt;id>''</code></tvar> above should be replaced with the appropriate user ID which you can see on the user's preference page.</translate>
::<translate><!--T:95--> Note: if <tvar name=1>{{ll|Manual:$wgDBprefix|$wgDBprefix}}</tvar> is defined in <tvar name=2><code>LocalSettings.php</code></tvar>, prepend its value to the table name.</translate> <translate><!--T:96--> For example, if <tvar name=1>{{phpi|$wgDBprefix}}</tvar> is "XYZ", then the table name to use is <code>XYZuser_groups</code></translate>
<translate>
====Temporarily let everyone assign rights to promote your initial user==== <!--T:97-->
</translate>
{{Warning|1=<translate><!--T:99--> You should not let outsiders access your wiki while you do this, if you use this method.</translate> <translate><!--T:100--> This method may leave your wiki temporarily vulnerable to attack while you do the procedure.</translate>}}
<translate>
<!--T:101-->
This method essentially involves letting all users temporarily modify user permissions in order to promote one user
<!--T:102-->
*Register a new account using the regular method (<tvar name=1>[[Special:UserLogin]]</tvar>).</translate> <translate><!--T:103--> Be logged in using that account.</translate>
<translate>
<!--T:104-->
*Add the following line to the bottom of <tvar name=1><code>LocalSettings.php</code></tvar></translate>
** <code>$wgGroupPermissions['user']['userrights'] = true;</code>
<translate>
<!--T:105-->
*Go to <tvar name=1>[[special:userrights]]</tvar> and add the user you just created to the ''Administrator'' and ''Bureaucrat'' groups.</translate>
<translate>
<!--T:106-->
*Remove the <tvar name=1><syntaxhighlight lang=php inline>$wgGroupPermissions['user']['userrights'] = true;</syntaxhighlight></tvar> line from your <tvar name=2>LocalSettings.php</tvar>.</translate> <translate><!--T:108--> This step is '''very important''', as until you remove it anyone can alter permissions, which is bad.</translate>
<translate>
===How do I reset a user's MediaWiki password?=== <!--T:109-->
</translate>
: ''<translate><!--T:110--> See <tvar name=1>{{ll|Manual:Resetting passwords}}</tvar></translate>''
<translate>
===How can I create interwiki links in my wiki?=== <!--T:111-->
</translate>
: ''<translate><!--T:112--> See <tvar name=1>{{ll|Manual:Interwiki}}</tvar></translate>''
<translate>
===How do I make my base URLs shorter?=== <!--T:113-->
</translate>
<sup><translate><!--T:719--> (i.e. <tvar name=1>/wiki/Article_Name</tvar> as opposed to /w/index.php?title=Article_Name)</translate></sup>
:''<translate><!--T:116--> See <tvar name=1>{{ll|Manual:Short URL}}</tvar></translate>''
<translate>
=== How do I organize pages into subdirectories like /wiki/subdir/PageName? === <!--T:117-->
</translate>
:''<translate><!--T:118--> See <tvar name=1>{{ll|Manual:$wgNamespacesWithSubpages}}{{int|and}}{{int|word-separator}}{{ll|Help:Subpages}}</tvar></translate>''
<translate>
===Is downloading and using all of MediaWiki.org free?=== <!--T:119-->
</translate>
<translate><!--T:120--> Yes, it is free in the sense of [[w:Free software|Free software]].</translate>
<translate><!--T:121--> See <tvar name=1>{{ll|Project:Copyrights}}</tvar> for licensing issues regarding the written content of this site.</translate>
{{anchor|How do I administrate/manage my users?}}<!-- compatibility anchor -->
<translate>
===How do I administrate/manage user rights?=== <!--T:122-->
</translate>
<translate><!--T:123--> See <tvar name=1>{{ll|Manual:User rights}}</tvar> for general information.</translate>
<translate><!--T:124--> See <tvar name=1>{{ll|Manual:Preventing access}}</tvar> for methods and strategies for restricting access.</translate>
<translate>
====How do I stop anonymous users from editing any page?==== <!--T:125-->
</translate>
<translate><!--T:126--> The recommended method is by changing the value of the <tvar name=1><code>{{ll|Manual:$wgGroupPermissions|$wgGroupPermissions}}</code></tvar> configuration option.</translate> 
<translate><!--T:127--> Edit <tvar name=1><code>{{ll|Manual:LocalSettings.php|LocalSettings.php}}</code></tvar> and add the line:</translate>
<syntaxhighlight lang="php">
$wgGroupPermissions['*']['edit'] = false;
</syntaxhighlight>
<translate><!--T:128--> If you use <tvar name=1>{{ll|Extension:AbuseFilter}}</tvar>, any admin can also disable IP editing temporarily as needed.</translate>
:''<translate><!--T:668--> See also:</translate> {{ll|Manual:Preventing access#Restrict anonymous editing|2=<translate><!--T:669--> Preventing access</translate>}}, {{ll|Manual:User rights}}''
<translate>
====How do I stop anonymous users from reading any page?==== <!--T:130-->
<!--T:131-->
*Add this to the bottom of <tvar name=1><code>LocalSettings.php</code></tvar>:
</translate>
<syntaxhighlight lang="php">
$wgGroupPermissions['*']['read'] = false;
</syntaxhighlight>
<translate><!--T:132--> See also <tvar name=1>{{ll|Manual:$wgWhitelistRead}}</tvar>.</translate>
<translate><!--T:133--> See [[<tvar name=1>Special:MyLanguage/Manual:Preventing access#Restrict viewing of all pages</tvar>|Manual:Preventing access#Restrict viewing of all pages]] for more information.</translate>
<translate>
====How do I restrict account creation?==== <!--T:134-->
<!--T:135-->
*Add this to the bottom of <tvar name=1><code>LocalSettings.php</code></tvar>:
</translate>
<syntaxhighlight lang="php">
$wgGroupPermissions['*']['createaccount'] = false;
</syntaxhighlight>
<translate>
<!--T:136-->
See [[<tvar name=1>Special:MyLanguage/Manual:Preventing access#Restrict account creation</tvar>|Manual:Preventing access#Restrict account creation]] for more information.
====How do I require an email address be specified at registration?==== <!--T:137-->
</translate>
:''<translate><!--T:138--> See <tvar name=1>{{ll|Manual:$wgEmailConfirmToEdit}}</tvar></translate>''
<translate>
===How do I put MediaWiki into ''Read Only'' mode?=== <!--T:139-->
</translate>
{{MW 1.5|and after}}
:''<translate><!--T:141--> See <tvar name=1>{{ll|Manual:$wgReadOnly}}</tvar></translate>''
<translate>
=== How do I change default user preferences? === <!--T:142-->
</translate>
{{MW 1.4|and after}}
<translate><!--T:144--> The MediaWiki default user preferences are in <tvar name=1>{{ll|Manual:MainConfigSchema.php|MainConfigSchema.php}}</tvar></translate>
<translate><!--T:145--> Don't edit that file, just use it for reference. </translate>
<translate><!--T:712--> Say if you want to hide minor edits in recent changes by default.</translate>
<translate><!--T:713--> <tvar name=1>MainConfigSchema.php</tvar> says:</translate>
<syntaxhighlight lang=php>
public const DefaultUserOptions = [
        ...
'hideminor' => 0,
        ...
]
</syntaxhighlight>
<translate><!--T:148--> To change the preference, put this in your <tvar name=1><code>LocalSettings.php</code></tvar>:</translate>
<syntaxhighlight lang=php>
$wgDefaultUserOptions["hideminor"] = 1;
</syntaxhighlight>
<translate><!--T:151--> To change the default namespaces to be searched, in any version of MediaWiki, set <tvar name=1>{{ll|Manual:$wgNamespacesToBeSearchedDefault|$wgNamespacesToBeSearchedDefault}}</tvar> in <tvar name=2>LocalSettings.php</tvar> to an array mapping namespace indexes to boolean values.</translate>
<translate><!--T:152--> For example, to search the main namespace and the category namespace, use:</translate>
<syntaxhighlight lang=php>
$wgNamespacesToBeSearchedDefault = [
    NS_MAIN => true,
    NS_CATEGORY => true,
];
</syntaxhighlight>
<translate>
<!--T:153-->
In some cases, after you change a default user preference, you may also want to change the user preferences of all existing user accounts.
</translate>
<translate><!--T:154--> If so, use the <tvar name=1>{{ll|Manual:userOptions.php|userOptions.php}}</tvar> script in the <tvar name=2><code>maintenance</code></tvar> directory.</translate> 
<translate><!--T:155--> Use the <tvar name=1><kbd>--dry</kbd></tvar> option for the first run, assess the impact and go from there. (<tvar name=1><kbd>--dry</kbd></tvar> does not write the database.)</translate>
php userOptions.php --dry --nowarn hideminor --old 0 --new 1
<translate><!--T:156--> Also, always backup your database before making these kinds of changes (you do not need to if you are just using <tvar name=1><kbd>--dry</kbd></tvar>).</translate>
:''<translate><!--T:670--> See also:</translate>'' {{ll|Manual:$wgDefaultUserOptions}}
<translate>
===How can I make MediaWiki run faster?=== <!--T:158-->
</translate>
:''<translate><!--T:671--> See:</translate> {{ll|Manual:Performance tuning}}''
<translate>
===How do MediaWiki and GDPR go together?=== <!--T:721-->
</translate>
:''<translate><!--T:722--> See <tvar name=1>[[GDPR (General Data Protection Regulation) and MediaWiki software]]</tvar></translate>''
<translate>
==Upgrading== <!--T:162-->
</translate>
:''<translate><!--T:163--> See <tvar name=1>{{ll|Manual:Upgrading}}</tvar></translate>''
<!-- {{#lst:Manual:Upgrading|FAQ}} -->
<translate>
==Moving== <!--T:164-->
===Is it possible to move my wiki to a different machine?=== <!--T:165-->
</translate>
<translate><!--T:166--> Yes.</translate>
<translate><!--T:167--> It should be.</translate>
<translate><!--T:168--> In essence, you will be backing up your old installation and then "restoring" it onto the new machine.</translate>
<translate><!--T:169--> Finally, you will have to make additional modifications to update the wiki configuration so that everything points to the new location.</translate>
<translate>
===How do I move my wiki to a different server?=== <!--T:170-->
<!--T:171-->
Follow the instructions at <tvar name=1>{{ll|Manual:Moving a wiki}}</tvar>.
==Changing the interface== <!--T:172-->
===How do I change the logo?=== <!--T:173-->
</translate>
{{caution|1=<translate><!--T:184--> Do not simply overwrite the default logo installed within MediaWiki</translate> (<code>/resources/assets/wiki.png</code>); <translate><!--T:185--> this file will be overwritten when you upgrade the software.</translate>}}
{{tip|1=<translate><!--T:774--> A larger size can be used by modifying the site’s CSS, but MediaWiki will not resize a logo that is too large.</translate> <translate><!--T:775--> Instead, only part of the image (specifically the upper left-hand corner) will be displayed, and if this corner is white, it may seem like the image is not displaying.</translate>}}
{{note|1=<translate><!--T:187--> The recommended size for a square logo is 135 × 135px, though the logo doesn’t have to be square, especially if it includes text below an image.</translate> <translate><!--T:188-->
The maximum logo size in the Vector skin is ~160 × 160px, while in MonoBook it’s ~155 × 155px.
</translate>}}
<translate><!--T:174--> The logo that appears in the top left of each page is determined by the <tvar name=1>{{ll|Manual:$wgLogos|$wgLogos}}</tvar> configuration line in the <tvar name=2>{{ll|Manual:LocalSettings.php|LocalSettings.php}}</tvar> file.</translate>
MediaWiki installations prior to [[:Category:MediaWiki configuration settings introduced in version 1.35.0|MediaWiki 1.35.0]], used {{ll|Manual:$wgLogo|$wgLogo}}.
<translate>
<!--T:175-->
There are two ways to change the logo:
</translate>
# <translate><!--T:176--> Upload a picture to your wiki using the normal file uploading interface.</translate> <translate><!--T:177--> This allows the logo to be replaced easily, so you may want to protect the page if you use this method.</translate>
#: <translate><!--T:776--> The resulting logo path will be <tvar name="1"><syntaxhighlight lang="php">"{$wgUploadPath}/6/62/mylogo.png";</syntaxhighlight></tvar></translate>
# <translate><!--T:179--> Upload a logo image to your server by other means (such as FTP).</translate>
#: <translate><!--T:777--> The resulting logo URL will be <tvar name="1"><syntaxhighlight lang="php">"{$wgScriptPath}/mylogo.jpg";</syntaxhighlight></tvar></translate>
#: <translate><!--T:181--> (In this example, the image is in the same folder as the <tvar name=1><code>LocalSettings.php</code></tvar> file.)</translate>
<translate><!--T:778--> Then, modify the <tvar name="1">{{wg|Logos}}</tvar> array in <tvar name=2>LocalSettings.php</tvar>.</translate>
<translate><!--T:779--> It should look something like:</translate>
<syntaxhighlight lang="php">
$wgLogos = [
'1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg"
'icon' => "$wgResourceBasePath/resources/assets/change-your-logo-icon.svg"
];
</syntaxhighlight>
<translate>
<!--T:780-->
Replace the paths above with the appropriate new logo path.
<!--T:182-->
If you only want to change the logo on specific pages, override #p-logo CSS's background-image property or use a third-party extension like <tvar name=1>{{ll|Extension:LogoFunctions}}</tvar>.
===How do I edit the wiki's CSS?=== <!--T:190-->
</translate>
<translate><!--T:191--> You shouldn't edit the CSS files (such as <tvar name=1>common.css</tvar>) directly, because it will make upgrading harder if you need to apply your customizations each time you upgrade the software.</translate>
<translate><!--T:192--> Instead you need to edit a wiki page called <tvar name=1>[[MediaWiki:Common.css]]</tvar> if you want to apply your CSS changes for all skins, or a wiki page called <tvar name=2>[[MediaWiki:Vector.css]]</tvar> if you want to apply the customizations only for the Vector skin.</translate>
<translate>
<!--T:193-->
The content of the MediaWiki:Common.css and MediaWiki:Vector.css pages always overrides the default CSS styles specified in the skin files.
===How do I hide the left vertical navigation toolbar?=== <!--T:194-->
<!--T:195-->
In other words, how do you make the main content div take up 100% of the display, hiding the logo, toolbox, navigation and search engine?
<!--T:196-->
To hide it permanently, copy and paste the following into the <tvar name=1>[[MediaWiki:Common.css]]</tvar> page:
</translate>
<syntaxhighlight lang="css">
#column-content { margin: 0 0 .6em 0; }
#content { margin: 2.8em 0 0 0; }
#p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search { display:none; }
#p-cactions { left: .1em; }
</syntaxhighlight>
<translate><!--T:197--> To instead hide the toolbar when the user presses F11, enter this in your wiki's <tvar name=1>[[MediaWiki:Common.js]]</tvar>:</translate>
<syntaxhighlight lang="javascript">
document.onkeydown = function( e ) {
if( e == null ) e = event
if( testKey( e, 122 ) ) { //F11
appendCSS('#column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search {display:none;} #p-cactions {left: .1em;} #footer {display:none;}');
return false;
}
}
function testKey( e, intKeyCode ) {
if( window.createPopup )
return e.keyCode == intKeyCode
else
return e.which == intKeyCode
}
</syntaxhighlight>
<translate>
=== How do I hide the categories at the bottom of each page? === <!--T:198-->
<!--T:199-->
You can hide display of the categories on each page by modifying your <tvar name=1>[[MediaWiki:Common.css]]</tvar> and adding:
</translate>
<syntaxhighlight lang="css">.catlinks { display: none; }</syntaxhighlight>
<translate>
===How do I customize the link-URL of the site-logo in the top left corner of all pages that activates when the site-logo is clicked upon?=== <!--T:211-->
</translate>
<translate><!--T:212--> By default, clicking the site-logo takes you to the main site-page.</translate>
<translate><!--T:213--> If you want to change which internal site-page is the "main" site-page, edit <tvar name=1>[[MediaWiki:Mainpage]]</tvar>.</translate>
<translate>
<!--T:729-->
To make the link of the site-logo link externally to any other arbitrary URL, you can use jQuery code within <tvar name=1>MediaWiki:Common.js</tvar>:
</translate>
<syntaxhighlight lang=javascript>
$("a.mw-wiki-logo").attr("href", "http://www.example.com");
$("a.mw-wiki-logo").attr("title", "<translate nowrap><!--T:730--> Go to <tvar name=1>example.com</tvar> website</translate>");
</syntaxhighlight>
<translate>
===How do I change the icon in the browser's address line (favicon)?=== <!--T:218-->
<!--T:219-->
*Simply upload your favicon.ico to the root of your domain/subdomain, make sure file name is in lower case and its name is favicon.ico</translate>
<translate>
<!--T:220-->
*Alternatively edit the <tvar name=1>{{ll|Manual:$wgFavicon|$wgFavicon}}</tvar> setting in <tvar name=2>LocalSettings.php</tvar> and add</translate> <syntaxhighlight lang=php inline>$wgFavicon = "$wgScriptPath/path/to/your/favicon.ico";</syntaxhighlight>
<translate>
<!--T:221-->
See <tvar name=1>{{ll|Manual:$wgFavicon}}</tvar> for more details.
<!--T:222-->
''Tip: The favicon image should be either 16 x 16 pixels or 32 x 32 pixels.''
====Rewrite Rule==== <!--T:223-->
</translate>
<translate><!--T:224--> If you are using a rewrite rule in .htaccess to remove "index.php" from the URL, you will also need to add an exception for .ico files.</translate>
<translate><!--T:225--> Simply add the following rule to your .htaccess:</translate>
<syntaxhighlight lang="apacheconf">RewriteRule .*\.ico$ - [L]</syntaxhighlight>
<translate>
<!--T:226-->
This rule must appear ''before'' the index.php rule.
====Case sensitivity==== <!--T:227-->
</translate>
<translate><!--T:228--> When uploading the favicon file, be sure the filename is in lowercase. (That is, "favicon.ico", not "Favicon.ico".)</translate>
<translate><!--T:229--> A lot of servers (e.g., those on UNIX-like operating systems) will not be able to find the file unless its name is in lowercase.</translate>
<translate>
===How do I customize the navigation bar?=== <!--T:230-->
</translate>
<translate><!--T:231--> The contents of the navigation bar which appears to the left of each page using the Vector or the Monobook skin are determined by the <tvar name=1>'''[[MediaWiki:Sidebar]]'''</tvar> page there on your wiki.</translate>
<translate><!--T:232--> For information on customising these, please see <tvar name=1>{{ll|Manual:Interface/Sidebar}}</tvar>.</translate>
<translate>
===How do I put a text message (sitenotice) on every page?=== <!--T:233-->
<!--T:234-->
Put a text in the <tvar name=1>'''[[MediaWiki:Sitenotice]]'''</tvar> page. It will be displayed on top of every article page.
</translate>
<translate><!--T:235--> You can also add text to <tvar name=1>'''[[MediaWiki:Anonnotice]]'''</tvar> to create a message that only displays for logged-out users.</translate> 
<translate><!--T:236--> It is often a good idea to transclude the site notice on the anon notice to make sure that logged-out users still get the information on the site notice.</translate>
<translate>
===How do I change which page is the main page?=== <!--T:237-->
</translate>
<translate><!--T:238--> By default, MediaWiki looks for a page with the title ''Main Page'' and serves this as the default page.</translate>
<translate><!--T:239--> This can be changed by altering the contents of <tvar name=1>'''{{ll|Creating a MediaWiki page|MediaWiki:Mainpage}}'''</tvar> to point to a different title.</translate>
<translate><!--T:240--> If this does not change the 'Main Page' link included on the sidebar at install time, edit <tvar name=1>'''{{ll|Creating a MediaWiki page|MediaWiki:Sidebar}}'''</tvar>.</translate>
<translate>
===How do I change the Main Page title?=== <!--T:241-->
<!--T:242-->
Simply click on the "Move" tab, and move the page to the desired page title.
<!--T:243-->
Usually you also want to [[<tvar name=1>#How do I change which page is the main page?</tvar>|change which page is the configured as "main page"]].
===How do I hide the main page title?=== <!--T:244-->
<!--T:732-->
The displayed title of the main page can be changed using the MediaWiki messages <tvar name=1>{{blue|MediaWiki:mainpage-title}}</tvar> and <tvar name=2>{{blue|MediaWiki:mainpage-title-loggedin}}</tvar> (for logged-out and logged-in users respectively). The main page title can be hidden by setting both messages to empty (or only either of them if the title should still be displayed to logged-out or logged-in users).
===How can I hide the table of contents?=== <!--T:250-->
</translate>
<translate><!--T:251--> The table of contents ([[TOC]]) is automatically shown once there are four or more headings in the article.</translate>
<translate><!--T:252--> There are multiple ways to hide it.</translate>
; <translate><!--T:253--> For one page</translate>
: <translate><!--T:254--> Place the magic word <tvar name=1><code>'''<nowiki>__NOTOC__</nowiki>'''</code></tvar> in the page's wikitext.</translate>
; <translate><!--T:255--> For all pages</translate>
:<translate><!--T:256--> Install <tvar name=1>{{ll|Extension:NoTOC}}</tvar></translate>
:<translate><!--T:257--> ''or''</translate>
: <translate><!--T:258--> Add the following rule to <tvar name=1>[[MediaWiki:Common.css]]</tvar>:</translate> <syntaxhighlight lang="css">.toc, #toc { display: none; }</syntaxhighlight>
; <translate><!--T:259--> Per user</translate>
: <translate><!--T:260--> Users can add the same CSS rule to their <tvar name=1>[[Special:MyPage/common.css|common.css]]</tvar> [[<tvar name=2>Special:MyLanguage/Manual:Interface/Stylesheets</tvar>|personal stylesheet]].</translate>
<translate>
===How do I change the interface text?=== <!--T:262-->
</translate>
<translate><!--T:263--> Interface text is altered using the MediaWiki namespace.</translate>
<translate><!--T:264--> For each deviation from the default in the site language there is a page MediaWiki:''Englishmessagename'', and for each deviation from the default in each other language a page MediaWiki:''Englishmessagename''/''languagecode''.</translate>
<translate><!--T:265--> (Since release 1.9 there are no pages for messages equal to the default.).</translate>
<translate><!--T:266--> On creation of a page the edit box autofills with the default.</translate>
<translate><!--T:267--> When creating a page to override the default it is useful to first save the default version, to allow diffs with it.</translate>
<translate><!--T:268--> See also <tvar name=1>{{ll|Help:System message}}</tvar>.</translate>
<translate>
<!--T:269-->
*For a list of system messages, see <tvar name=1>'''[[Special:Allmessages]]'''</tvar></translate>
<translate>
<!--T:270-->
*To switch ''off'' the MediaWiki namespace, see the <tvar name=1>{{ll|Manual:$wgUseDatabaseMessages|$wgUseDatabaseMessages}}</tvar> configuration setting</translate>
<translate>
<!--T:271-->
*To remove the ''Privacy policy'' or ''Disclaimers'' links at the bottom of each page, set the content of pages <tvar name=1>'''[[MediaWiki:Privacy]]'''</tvar> or <tvar name=2>'''[[MediaWiki:Disclaimers]]'''</tvar> respectively to a single hyphen (<code>-</code>).
=== How do I edit error messages? === <!--T:326-->
<!--T:327-->
<tvar name=1>[[Special:Allmessages]]</tvar> contains a complete list of messages (error or otherwise), that can be edited.
<!--T:753-->
You may also add <tvar name=1>?uselang=qqx</tvar> or <tvar name=2>&uselang=qqx</tvar> to a URL which will display the name of each messages in the interface.
===How do I change the interface language?=== <!--T:272-->
<!--T:273-->
To change the default interface language, alter the value of <tvar name=1><code>{{ll|Manual:$wgLanguageCode|$wgLanguageCode}}</code></tvar> in <tvar name=2><code>LocalSettings.php</code></tvar>, for example
</translate>
<syntaxhighlight lang="php">
$wgLanguageCode = "fr";
</syntaxhighlight>
<translate>
<!--T:274-->
You may also need to [[w:Wikipedia:Bypass_your_cache|bypass your browser's cache]] to see the changes.
<!--T:275-->
The new default interface language will be applied to all users who haven't ever customised it.
<!--T:276-->
If you want to provide users the possibility to create and choose pages and interface elements in languages other than the default one of the wiki, you need the <tvar name=1>{{ll|Extension:Translate|nsp=0}}</tvar> extension, which can make your wiki multilingual.
</translate>
<translate><!--T:279--> If you want to change the language settings for all existing users, use the <tvar name=1>{{ll|Manual:userOptions.php|userOptions.php}}</tvar> [[<tvar name=2>Special:MyLanguage/Manual:Maintenance scripts</tvar>|maintenance script]].</translate>
<translate><!--T:280--> For instance, to have all users with English set use French instead, run:</translate>
<syntaxhighlight lang="php">
php userOptions.php language --old en --new fr
</syntaxhighlight>
<translate>
===How do I remove the article/edit etc tabs?=== <!--T:281-->
<!--T:282-->
''For a little more control see: <tvar name=1>[[User:Subfader/Hide_page_tabs]]</tvar>''
<!--T:283-->
Edit <tvar name=1>[[MediaWiki:Common.css]]</tvar> on your wiki, and add this:</translate>
<syntaxhighlight lang="css">li#ca-edit { display: none; }</syntaxhighlight>
<translate><!--T:284--> See the page source for the various #ca-* ids used in the content tabs.</translate>
{{note|1=<translate><!--T:285--> This will only work for Monobook and derived skins such as Modern and Vector (the default skin), and doesn't actually stop people from editing.</translate> <translate><!--T:286--> To do that, see <tvar name=1>{{ll|Manual:User rights}}</tvar>.</translate>}}
<translate>
===How do I add/remove tabs throughout my wiki?=== <!--T:287-->
<!--T:288-->
See <tvar name=1>{{ll|Manual:User group CSS and JavaScript}}</tvar>
====How do I remove a tab on only one page?==== <!--T:294-->
</translate>
{{MW 1.9|and after}}
<translate><!--T:296--> For example, to remove the Discussion (talk) page tab from the Main Page, on the <tvar name=1>[[MediaWiki:Common.css]]</tvar> page add:</translate>
<syntaxhighlight lang="css">
body.page-Main_Page li#ca-talk { display: none !important; }
</syntaxhighlight>
<translate><!--T:297--> To modify <tvar name=1>[[MediaWiki:Common.css]]</tvar> you must be an <tvar name=2>{{ll|Manual:interface administrator|nsp=0}}</tvar>.</translate>
:''<translate><!--T:672--> See also:</translate> {{ll|Manual:Hide page tabs}}''
<translate>
====How do I remove a tab on all pages==== <!--T:299-->
</translate>
{{MW 1.9|and after}}
<translate><!--T:301--> For example, to remove the Discussion (talk) page tab on all wikipages, on the <tvar name=1>[[MediaWiki:Common.css]]</tvar> page add:</translate>
<syntaxhighlight lang="css">
#ca-talk { display:none!important; }
</syntaxhighlight>
<translate>
<!--T:302-->
Other tabs to remove are '''#ca-history''',  '''#ca-viewsource''', '''#ca-view''' (Read tab), '''#ca-nstab-main''' (Page tab).
<!--T:303-->
Other drop down menu items you can remove are '''#ca-watch''', '''#ca-move''', '''#ca-delete'''.
<!--T:304-->
To modify <tvar name=1>[[MediaWiki:Common.css]]</tvar> you must be an <tvar name=2>{{ll|Manual:interface administrator|nsp=0}}</tvar>.
===How do I remove the "Talk for this IP" link at the top right (e.g. when <tvar name=1>{{ll|Manual:$wgDisableAnonTalk|$wgDisableAnonTalk}}</tvar> is true)?=== <!--T:309-->
<!--T:679-->
One option is to hide the link using the following CSS in the wiki page ''MediaWiki:Common.css'' in your wiki:
</translate>
<syntaxhighlight lang="css">
#p-personal #pt-anonuserpage {
    display: none;
}
</syntaxhighlight>
<translate>
===How do I remove the "Create an Account or Login" link at the top right of the screen?=== <!--T:311-->
<!--T:312-->
To remove the login / create account links from the personal_urls you can use this code in your <tvar name=1>{{manual|LocalSettings.php}}</tvar> to hook in and remove them:
</translate>
<syntaxhighlight lang=php>
$wgHooks['SkinTemplateNavigation::Universal'][] = function ( $skinTemplate, &$links ) {
unset( $links['user-menu']['login'] );
unset( $links['user-menu']['login-private'] );
unset( $links['user-menu']['createaccount'] );
};
</syntaxhighlight>
<translate>
===How can I suppress actions and special pages?=== <!--T:313-->
<!--T:742-->
To disable a specific special page (such as Special:SpecialPages), you may use:
</translate>
<syntaxhighlight lang="php">
$wgSpecialPages['<translate nowrap><!--T:743--> Name</translate>'] = DisabledSpecialPage::getCallback( '<translate nowrap><!--T:744--> Name</translate>', '<translate nowrap><!--T:745--> message</translate>' );
</syntaxhighlight>
<translate>
<!--T:746-->
where <code>Name</code> is the canonical (English) name of the special page to disable, and <code>message</code> is the message to be shown to users when they try to access the special page.
<!--T:747-->
To disable an action (such as edit), you may use:
</translate>
<syntaxhighlight lang="php">
$wgActions['edit'] = false;
</syntaxhighlight>
<translate>
<!--T:748-->
See <tvar name=1>{{ll|API:Restricting API usage}}</tvar> to disable an API module.
<!--T:749-->
This is only the basic usages. Usually you may want to disable special pages, actions or API modules conditionally.
===How do I change the footer?=== <!--T:328-->
</translate>
:''<translate><!--T:691--> See:</translate> {{ll|Manual:Footer}}, {{ll|Manual:Configuration settings#Copyright|2=<translate><!--T:692--> Manual:Configuration settings#Copyright</translate>}}''
{{Anchor|powered-by-mw-image}}
<translate>
===How can I edit / remove the Powered by MediaWiki image (and possible other images) from the footer?=== <!--T:330-->
<!--T:331-->
You can hide the Powered by MediaWiki image by adding the following to your wiki's <tvar name=1>[[MediaWiki:Common.css]]</tvar>:
</translate>
<syntaxhighlight lang="css">
#footer-poweredbyico { display: none; }
</syntaxhighlight>
<translate><!--T:335--> If you want to remove it completely, you can use <tvar name=1>{{wg|FooterIcons}}</tvar> to remove it using this in your <tvar name=2>{{manual|LocalSettings.php}}</tvar>:</translate>
<syntaxhighlight lang=php>unset( $wgFooterIcons['poweredby'] );</syntaxhighlight>
<translate>
<!--T:750-->
Note that this will also remove ''other'' powered-by icons, e.g. also the one coming from BlueSpice.
<!--T:337-->
If you wish to change the icon images, urls, alt text, or add new icons please see <tvar name=1>{{wg|FooterIcons}}</tvar>' documentation.
===How do I add a reply link to default signature tildes (<tvar name=1><nowiki>~~~~</nowiki></tvar>) template?=== <!--T:338-->
<!--T:781-->
Install <tvar name="1">{{ll|Extension:DiscussionTools|nsp=0}}</tvar> to enable automatic reply links on talk pages.
===How can I change what the <tvar name=1>{{tag|title|open}}</tvar> of each page is? Where do I make changes?=== <!--T:342-->
<!--T:343-->
Most of the text that you want to change can be found in the namespace of MediaWiki.
</translate>
<translate><!--T:344--> In order to change titles, texts, announcements, etc., go to <tvar name=1>[[Special:AllMessages]]</tvar>, where you will see the text associated with the pages you wish to change.</translate>
<translate><!--T:345--> You need to log in as an administrator to edit the protected entries in the MediaWiki namespace.</translate>
<translate><!--T:346--> If you want to change the title in your browser, you need to edit <tvar name=1>[[MediaWiki:Pagetitle]]</tvar>.</translate>
<translate><!--T:347--> Go there and edit it just like you would any other page in your wiki.</translate>
<translate>
<!--T:348-->
In recent versions of MediaWiki, [[MediaWiki:Pagetitle]] is <tvar name=1><nowiki>$1 - {{SITENAME}}</nowiki></tvar> by default. If <tvar name=2><nowiki>{{SITENAME}}</nowiki></tvar> is producing the wrong text for you, you need to set <tvar name=3>{{ll|Manual:$wgSitename|$wgSitename}}</tvar> in your <tvar name=4>LocalSettings.php</tvar>.
<!--T:352-->
Don't forget to clear your browser cache after you change your settings.
===Does MediaWiki automatically capitalize the first letter of $wgSitename?=== <!--T:353-->
</translate>
<translate><!--T:354--> Yes.</translate>
<translate><!--T:355--> This can be changed using the <tvar name=1>{{ll|Manual:$wgCapitalLinks|$wgCapitalLinks}}</tvar> configuration setting.</translate>
<translate>
===How do I make external links open in a new window?=== <!--T:356-->
</translate>
:''<translate><!--T:357--> See <tvar name=1>{{ll|Manual:$wgExternalLinkTarget}}</tvar></translate>''
<translate>
===How can I suppress MediaWiki from formatting URLs, tags, etc?=== <!--T:358-->
<!--T:359-->
Put "<tvar name=nowiki>{{tag|nowiki|pair|content=}}</tvar>" tags around the URL or tag.
<!--T:360-->
''Example:''
</translate>
<nowiki>svn co <nowiki>http://svn.example.com/myproject/</nowiki></nowiki>
<translate><!--T:361--> ''Produces:''</translate><br/>
svn co <nowiki>http://svn.example.com/myproject/</nowiki>
<translate>
===How can I force users to preview before they save?=== <!--T:362-->
</translate>
: ''<translate><!--T:706--> See:</translate> {{ll|Manual:Force preview}}, {{ll|Extension:ForcePreview}}''
<translate>
===How do I add more buttons on the edit page?=== <!--T:364-->
</translate>
:''<translate><!--T:707--> See:</translate> {{ll|Manual:Custom edit buttons}}''
<translate>
===How can I get more special characters or tags clickable on the edit page?=== <!--T:366-->
<!--T:367-->
For adding more selectable special characters, etc., below the edit field, see <tvar name=1>{{ll|Extension:CharInsert}}</tvar>.
=== How can I use a different skin on my wiki? === <!--T:368-->
<!--T:371-->
See <tvar name=1>{{ll|Manual:$wgDefaultSkin}}</tvar> for more information on configuring your default skin.
=== How do I disable external links from showing in the printable version of a page? === <!--T:373-->
<!--T:374-->
Edit the page <tvar name=1>[[MediaWiki:Print.css]]</tvar> on your wiki and add the following code there:
</translate>
<syntaxhighlight lang="css">
#content a.external.text:after,
#content a.external.autonumber:after {
content: none;
}
</syntaxhighlight>
<translate><!--T:375--> This will override the styles defined in the CSS files coming with the MediaWiki source code.</translate>
<translate><!--T:376--> For more information, see <tvar name=1>{{ll|Manual:CSS}}</tvar>.</translate>
<translate><!--T:377--> If instead you want to have the external links ''underlined'' in the printable version, then also add the following code:</translate>
<syntaxhighlight lang="css">
#content a.external {
    text-decoration: underline !important;
}
</syntaxhighlight>
<translate>
=== How do I print footnotes at the bottom of each printed page? === <!--T:717-->
<!--T:718-->
Try this StackOverflow solution: [<tvar name=url>https://stackoverflow.com/a/23622470</tvar> Printed HTML per-page footnotes]
</translate>
{{anchor|How do I change the text of the tab of my wikis main page?}}
<translate>
===How do I change the text of the article (page name) tab of my wiki's main page?=== <!--T:378-->
<!--T:380-->
To change the text of the tab, as one example used in Wikipedia, you first open the page "<tvar name=1><code>MediaWiki:Mainpage-nstab</code></tvar>".
</translate>
<translate><!--T:381--> After you've done that, click Edit and type in the edit box the text you want to be seen later on the main page - that's it.</translate>
<translate><!--T:382--> Don't forget to save the page as well.</translate>
<translate>
=== How do I change the background color? === <!--T:761-->
<!--T:762-->
To change the background color of the MediaWiki interface outside of the page content and tabs, add the following CSS to the MediaWiki page <tvar name=commoncss><code><nowiki>[[MediaWiki:Common.css]]</nowiki></code></tvar>:
</translate>
<syntaxhighlight lang="css">
/* Changes the background color of the bottom and left of each page, up to behind half of the logo: */
body {
  background: red;
}
/* Changes the background color behind the top half of the logo and at top of each page: */
#mw-page-base {
  background: red;
}
</syntaxhighlight>
<translate><!--T:763--> This will change the background color outside of the tabs, search, and page content to <span style=color:red>red</span>.</translate>
<translate><!--T:764--> See <tvar name=1>{{ll|Manual:CSS}}</tvar> for more information.</translate>
<translate>
=== How do I load external fonts? === <!--T:765-->
</translate>
<translate><!--T:766--> This example refers to Google Fonts, a repository of free open-source fonts that you can use with MediaWiki.</translate>
<translate><!--T:767--> Go to <tvar name=link>https://fonts.google.com/</tvar>, find fonts that you like, and select them by clicking the "plus" (+) icon.</translate>
<translate><!--T:768--> Select one or more fonts to be added.</translate>
<translate><!--T:769--> Click the tab for the pop-up notification, and then select "@IMPORT". Copy and paste the resulting CSS into <tvar name=commoncss><code><nowiki>[[MediaWiki:Common.css]]</nowiki></code></tvar>. The examples below use [[w:Noto Sans|Noto Sans]] and Noto Serif. They are default fonts for Android operating system and have good support for [[w:Unicode|Unicode]] text.</translate>
<syntaxhighlight lang="css">
@import url( 'https://fonts.googleapis.com/css?family=Noto+Sans|Noto+Serif' );
/* Changes the default font used for MediaWiki to Noto Sans (does not include headings or monospaced text): */
body {
  font-family: "Noto Sans", sans-serif;
}
/* Changes the default font used for MediaWiki headings to Noto Serif: */
#content h1,
#content h2 {
  font-family: "Noto Serif", serif;
}
</syntaxhighlight>
<translate>
===How to hide the "Your edit was saved" notification?=== <!--T:783-->
</translate>
<translate><!--T:784--> Edit the wiki page <tvar name=1><code>MediaWiki:Common.css</code></tvar> on your wiki to include the line <tvar name=2><code>.postedit {display: none;}</code></tvar>.</translate>
See {{ll|Manual:Interface/Stylesheets}} for more information.
<translate>
==Basic usage== <!--T:383-->
===How do I edit a page?=== <!--T:384-->
</translate>
<translate><!--T:385--> To edit a page, simply click the '''edit''' link that appears on each page.</translate>
<translate><!--T:386--> Using the default Vector skin, this is in the form of a tab at the top of the page.</translate>
<translate><!--T:387--> A form will appear, containing the existing markup.</translate>
<translate><!--T:388--> When you have finished making modifications, click the '''Save''' button to commit your changes.</translate>
:''<translate><!--T:673--> See also:</translate> {{ll|Help:Editing pages}}''
<translate>
===How do I create a new page?=== <!--T:390-->
<!--T:391-->
There are several ways to create a new page:
<!--T:392-->
*Create a link to the page on another page, then click on the red link which appears</translate>
<translate>
<!--T:393-->
*Browse to the intended location of the page, e.g. <code><nowiki>http://www.example.com/index.php?title=New_page</nowiki></code> and click on the "'''Edit'''", "'''Create'''" or "'''Create source'''" link.
<!--T:394-->
On some wikis, a failed search for a page will contain a link which allows you to edit that page.
</translate>
:''<translate><!--T:674--> See also:</translate> {{ll|Help:Starting a new page}}''
<translate>
===How do I delete an old version of a page?=== <!--T:396-->
</translate>
<translate><!--T:397--> Old versions of page data are retained in the database and can be accessed via the page history features.</translate>
<translate><!--T:398--> This is useful for reviewing changes and correcting or reverting undesirable ones, but in some cases, administrators might want to make this information unavailable, for legal reasons, or to reduce the size of the database.</translate>
<translate>
<!--T:399-->
*Administrators can delete an old revision of a page by deleting the page, and then selectively undeleting revisions to be kept</translate>
<translate>
<!--T:401-->
* You can enable the core <tvar name=1>{{ll|RevisionDelete}}</tvar> feature that allows privileged users to remove single revisions from page histories.</translate>
<translate>
<!--T:402-->
*The <tvar name=1><code>maintenance/{{ll|Manual:deleteOldRevisions.php|deleteOldRevisions.php}}</code></tvar> [[<tvar name=2>Special:MyLanguage/Manual:Maintenance scripts</tvar>|maintenance script]] can mass-delete all old revisions of pages and their associated text records.
</translate>
:''<translate><!--T:675--> See also:</translate> {{ll|Manual:Removing embarrassment}}''
<translate>
===How do I use oversight/delete revisions in the page history?=== <!--T:404-->
</translate>
:''<translate><!--T:676--> See:</translate> {{ll|RevisionDelete}}''
<translate>
<!--T:406-->
You can also delete a page, and then restore only the revisions you want.
===Are there any editing tutorials available?=== <!--T:407-->
</translate>
<translate><!--T:408--> There are several editing tutorials available, mostly on Wikimedia sister projects, such as Wikipedia.</translate>
<translate><!--T:409--> There are also markup references, etc. available on ''Meta''.</translate>
<translate>
<!--T:410-->
*The page <tvar name=1>{{ll|Help:Editing pages}}</tvar> on this site</translate>
<translate>
<!--T:412-->
*The ''[[:en:Wikipedia:How to edit a page|How to edit a page]]'' guide on the English Wikipedia
===How do I view the printable form of a page?=== <!--T:413-->
</translate>
{{See also|Help:Printing}}
<translate>
<!--T:414-->
MediaWiki includes stylesheets which automatically style a page appropriately when it is printed; using the print or print preview function within your browser ought to render the page in a printable form.
<!--T:415-->
You can also view this printable form using the ''printable version'' link in the sidebar under ''Toolbox'' or ''Print/export'' if using the <tvar name=1>{{ll|Extension:Collection|nsp=0}}</tvar> extension.
=== How do I use templates? === <!--T:416-->
</translate>
:''<translate><!--T:417--> See <tvar name=1>{{ll|Help:Templates}}</tvar></translate>''
<translate>
===Can I use media (images, video, audio, etc.) from [[<tvar name=1>m:Special:MyLanguage/Wikimedia Commons</tvar>|Wikimedia Commons]] in my installed version of MediaWiki?=== <!--T:418-->
<!--T:419-->
Yes, this is encouraged through the use of <tvar name=1>{{ll|Manual:$wgUseInstantCommons}}</tvar>.
</translate>
:''<translate><!--T:677--> See also:</translate> {{ll|InstantCommons}}''
<translate>
===How do I use a template as a signature?=== <!--T:421-->
</translate>
<translate><!--T:422--> When you look at your preferences, you see a check box for "raw signature."</translate> 
<translate><!--T:423--> But the field will only take a certain number of characters.</translate> 
<translate><!--T:424--> What if you want more?</translate>
<translate><!--T:425--> You will need to create two pages, possibly in your userspace.</translate>
#<translate><!--T:426--> Create the first page (FIRST PAGE)</translate>
# <translate><!--T:427--> Go to your preferences, check "raw signature" and put <tvar name=1><nowiki>{{FIRST PAGE}}</nowiki></tvar> in the signature.</translate> {{int|saveprefs}}
#<translate><!--T:429--> Create a second page (SECOND PAGE) (possibly a sub-page of the first)</translate>
#<translate><!--T:430--> Go back to the first page (FIRST PAGE) and do <tvar name=1><nowiki>{{SECOND PAGE}}</nowiki></tvar></translate>
#<translate><!--T:431--> Go to the second page (SECOND PAGE) and place the code you wish to have for your signature.</translate>
<translate><!--T:432--> If you don't have this structure, you will still be inserting all your signature code into the raw code wherever your signature is used, because the software will insert "SUBST" in your preferences.</translate> 
<translate><!--T:433--> You may not mind this, in which case you only need one page.</translate> 
<translate><!--T:434--> If you want the raw code to only display <tvar name=1><nowiki>{{FIRST PAGE}}</nowiki></tvar>, which looks a lot cleaner, then you need to use the two-page structure.</translate>
<translate>
=== How do I add the sandbox functionality to my installation of the wiki? === <!--T:435-->
</translate>
<translate><!--T:436--> In wiki terms, a ''sandbox'' is simply a "play pen"; a page which users can mess about in.</translate>
<translate><!--T:437--> This is an ordinary page created in the normal manner, and can be located wherever you like.</translate>
<translate><!--T:438--> There is no special sandbox functionality built into MediaWiki.</translate>
<translate><!--T:439--> Users often inquire about the Wikipedia sandboxes, which seem to be self-emptying.</translate>
<translate><!--T:440--> This is not quite correct; there are a number of volunteers who run [[<tvar name=1>Special:MyLanguage/Manual:Bots</tvar>|bots]] to clean these up and return them to a certain state at regular time intervals.</translate>
<translate>
<!--T:751-->
See also <tvar name=2>{{ll|Extension:SandboxLink}}</tvar> which will add a link to user's personal sandbox (i.e. a subpage of personal user page)  to personal tools menu.
=== How do I make my wiki serve all languages? === <!--T:444-->
</translate>
* <translate><!--T:785--> To allow user to switch the language of the interface, see <tvar name=1>{{ll|Extension:UniversalLanguageSelector}}</tvar></translate>
* <translate><!--T:445--> To allow translation of pages and of the custom interface (like the sidebar), use the <tvar name=1>{{ll|Extension:Translate|Translate}}</tvar> extension; there's [[<tvar name=2>Special:MyLanguage/Help:Extension:Translate</tvar>|extensive documentation]].</translate>
<translate>
==Wiki importing== <!--T:446-->
===Importing from MediaWiki XML dumps=== <!--T:447-->
</translate>
:''<translate><!--T:708--> See:</translate> {{ll|Manual:Importing XML dumps}}''
<translate>
===Importing from other types of wiki software=== <!--T:449-->
</translate>
{{main|Manual:Importing external content}}
<translate>
===Importing from other types of files=== <!--T:467-->
<!--T:468-->
There are a variety of tools available to help convert content from HTML (and other formats) to MediaWiki markup.
</translate>
; <translate><!--T:469--> Developer and SysAdmin tools</translate>
* [http://search.cpan.org/dist/HTML-WikiConverter-MediaWiki HTML::WikiConverter::MediaWiki] &ndash; <translate><!--T:470--> a Perl module for converting from HTML to MediaWiki markup.</translate>
* [[m:Special:MyLanguage/Wikificator|Wikificator]] &ndash; <translate><!--T:471--> a JavaScript MediaWiki extension that converts XHTML to MediaWiki markup.</translate>
<translate>
<!--T:472-->
* The <tvar name=1>{{ll|Manual:Edit.php|Edit.php}}</tvar> and <tvar name=2>{{ll|Manual:importImages.php|importImages.php}}</tvar> [[<tvar name=3>Special:MyLanguage/Manual:Maintenance scripts</tvar>|maintenance scripts]] can be used to import text and images into MediaWiki.</translate>
; <translate><!--T:473--> End-user tools</translate>
<translate>
<!--T:475-->
* [[w:User:Cacycle/wikEd|wikEd]] &ndash; a text editor for MediaWiki that can import HTML (including Microsoft Word-generated HTML.)</translate>
;<translate><!--T:476--> Instructions</translate>
<translate>
<!--T:477-->
*[<tvar name=url>http://xpt.sourceforge.net/techdocs/language/wiki/wikimedia/wkm07-MediaWikiImport/ar01s04.html</tvar> Brief notes on converting from Microsoft .chm help files to MediaWiki]</translate>
<translate>
<!--T:478-->
*[<tvar name=url>http://openwetware.org/wiki/Converting_documents_to_mediawiki_markup#Word_Documents</tvar> Notes on converting from Microsoft Office formats to MediaWiki]
=== Templates imported from other wikis (such as Wikipedia) don't work for me === <!--T:508-->
</translate>
<translate><!--T:509--> You probably need to install some extensions used on the source wiki, such as <tvar name=3>{{ll|Extension:Scribunto|Scribunto}}</tvar>, <tvar name=4>{{ll|Extension:TemplateStyles|TemplateStyles}}</tvar>, <tvar name=1>{{ll|Extension:ParserFunctions|ParserFunctions}}</tvar> or sometimes <tvar name=2>{{ll|Extension:Cite|Cite}}</tvar>.</translate>
<translate><!--T:510--> Also, make sure that you copied all [[<tvar name=1>Special:MyLanguage/Manual:Interface/Stylesheets</tvar>|site CSS]] and [[<tvar name=2>Special:MyLanguage/Manual:Interface/JavaScript</tvar>|JavaScript]] required by the template.</translate>
<translate>
==Customising further== <!--T:511-->
===I want to have multiple wikis, but only require registration once=== <!--T:512-->
<!--T:513-->
*If you're starting from scratch or you're switching from one wiki to multiple, you can use <tvar name=1>{{ll|Manual:$wgSharedDB|$wgSharedDB}}</tvar> and <tvar name=2>{{ll|Manual:$wgSharedTables|$wgSharedTables}}</tvar> to have all wikis share the <tvar name=3><code>user</code></tvar> table of the "main" wiki.</translate> <translate><!--T:514--> You can share other tables as well, as long as they don't contain any data dependent on non-shared tables or data specific to one wiki.</translate> <translate><!--T:515--> See <tvar name=1>{{ll|Manual:Shared database}}</tvar> for examples and more information.</translate>
<translate>
<!--T:516-->
*If your wikis are already established and you want to switch to a single sign-on, you can use the <tvar name=1>{{ll|Extension:CentralAuth|CentralAuth}}</tvar> extension.</translate> <translate><!--T:517--> It has a few more features than a shared <tvar name=1><code>user</code></tvar> table, but it's more difficult to configure and it's tailored toward a Wikimedia-style setup.</translate> <translate><!--T:518--> However, it is easier than attempting to completely merge multiple <tvar name=1><code>user</code></tvar> tables into one.</translate>
<translate>
===How can I allow use of HTML tags?=== <!--T:519-->
<!--T:520-->
See <tvar name=1>{{ll|Manual:$wgRawHtml}}</tvar> as well as <tvar name=2>{{ll|Manual:$wgGroupPermissions}}{{int|and}}{{int|word-separator}}{{ll|Manual:Preventing access}}</tvar>.
</translate>
{{caution|1=<translate><!--T:522--> This can be easily abused to attack users</translate>}}
<translate>
<!--T:523-->
See <tvar name=1>{{ll|HTML restriction}}</tvar> for ways to make this safer.
===How do I fix problems or add features to MediaWiki?=== <!--T:524-->
<!--T:525-->
The basic steps to improving MediaWiki (that is, [[<tvar name=1>Special:MyLanguage/How to become a MediaWiki hacker</tvar>|becoming a MediaWiki developer]]) are:
<!--T:526-->
* Install [[<tvar name=1>Special:MyLanguage/Gerrit</tvar>|Git]]</translate>
<translate>
<!--T:527-->
* Download the Git "clone" of the MediaWiki source code</translate>
<translate>
<!--T:528-->
* Get a server, a database, and PHP running on your computer (this can be annoying, so please ask for help if something isn't working)</translate>
<translate>
<!--T:529-->
* Get MediaWiki running on your computer off that Git checkout (can be annoying as well, so, ditto)</translate>
<translate>
<!--T:530-->
* Fix the problem or add the feature you were thinking of</translate>
<translate>
<!--T:531-->
* Edit the source code of the relevant file(s) to fix the problem</translate>
<translate>
<!--T:532-->
* Follow <tvar name=1>{{ll|Gerrit/Tutorial}}</tvar>
=== How do I run a bot? === <!--T:533-->
</translate>
:''<translate><!--T:709--> See:</translate> {{ll|Manual:Bots}}''
<translate><!--T:535--> You might want to use the <tvar name=1>{{ll|Manual:Pywikibot|Pywikibot}}</tvar> framework.</translate>
<translate>
=== How do I change noindex nofollow === <!--T:536-->
<!--T:537-->
Set <tvar name=code><code class="mw-highlight">{{ll|Manual:$wgNoFollowLinks|$wgNoFollowLinks}} = {{#tag:span|false|class=k}};</code></tvar> in <tvar name=1>{{ll|Manual:LocalSettings.php|LocalSettings.php}}</tvar>
=== How do I add [[w:Meta element|meta tags]]? === <!--T:540-->
</translate>
<translate><!--T:541--> The OutputPage class includes an addMeta method which can be used to add meta tags.</translate>
<translate><!--T:542--> The <tvar name=1>{{ll|RequestContext}}</tvar> can be used to get the relevant OutputPage object.</translate>
<syntaxhighlight lang=php>
$out->addMeta ( 'description', '<translate nowrap><!--T:752--> This is a meta description.</translate>' );
</syntaxhighlight>
<translate>
==Why...?== <!--T:544-->
===…is the Help namespace empty?=== <!--T:545-->
</translate>
<translate><!--T:546--> The Help namespace currently ships in a blank state.</translate>
<translate><!--T:547--> It's up to you how much or how little help you give to your site visitors and whether this relates to other aspects of your site.</translate>
<translate><!--T:548--> Obviously you can easily link your visitors to help resources elsewhere.</translate>
<translate><!--T:549--> We don't currently have a clean, internationalised set of help pages under a free license.</translate>
<translate><!--T:550--> However, if you want to copy in some help information onto your site, about how to use a wiki (a MediaWiki powered wiki) you are free to copy the <tvar name=1>{{ll|Help:Contents}}</tvar> from this wiki.</translate>
<translate><!--T:551--> This set of pages have been deliberately created for this purpose, with wiki-neutral information, and no license restrictions.</translate>
<translate><!--T:552--> See <tvar name=1>{{ll|Project:PD help}}</tvar>.</translate>
<translate>
===…are some of my images not showing up after an upgrade?=== <!--T:553-->
</translate>
<translate><!--T:554--> Several users have reported that, following an upgrade or a moving of their wiki, several images fail to be shown inline.</translate>
<translate><!--T:555--> The files exist, and the image description pages show a MIME type of <tvar name=1><code>unknowncode>/unknown</code></tvar> and, in some cases, a warning about potentially dangerous files.</translate>
<translate><!--T:556--> To fix this, run the <tvar name=1><code>maintenance/rebuildImages.php</code></tvar> script from the command line.</translate>
<translate><!--T:557--> This will set MIME information for each file in the database.</translate>
<translate><!--T:683--> MediaWiki 1.21 and newer implements [[<tvar name=1>Special:MyLanguage/Manual:$wgResponsiveImages</tvar>|responsive images]].</translate>
<translate><!--T:684--> Due to [[<tvar name=bug>phab:T181987</tvar>|a bug]], if the server locale is set to one that uses commas instead of dots for representing a decimal point, images may not render on some browsers/devices.</translate>
<translate><!--T:685--> This can be confirmed by inspecting a thumbnail of a medium or big image on a page with the browser tools, looking at the HTML code, and see if the <tvar name=1><code>srcset</code></tvar> attribute contains commas instead of dots when representing the <tvar name=2><code>1.5x</code></tvar> value.</translate>
<translate>
===…are all PNG files not being turned into thumbnails?=== <!--T:558-->
</translate>
<translate><!--T:559--> After upgrading to a more recent version of PHP, it is possible a different MimeMagic.php function is being used to detect file MIME types, particularly the built-in PHP function mime_content_type, which fails to detect PNG files.</translate>
<translate><!--T:560--> Search the web for <tvar name=1>''mime_content_type png''</tvar> for information on fixing this bug at the PHP level, possibly by editing your magic.mime file.</translate>
<translate>
<!--T:561-->
See [[<tvar name=1>#"File is corrupt or has an invalid extension"</tvar>|File is corrupt or has an invalid extension]] for more info.
===…can't I download MediaWiki <tvar name=1>{{padright:{{#expr:{{MW stable branch number}}+.01}}|4}}</tvar>?=== <!--T:567-->
</translate>
<translate><!--T:568--> MediaWiki <tvar name=1>{{padright:{{#expr:{{MW stable branch number}}+.01}}|4}}</tvar> is in a development state at present, and has not been packaged into a general release.</translate>
<translate><!--T:569--> The code can be [[<tvar name=1>Special:MyLanguage/Download from Git</tvar>|downloaded from Git]] if desired.</translate>
<translate><!--T:570--> Or, if you want the latest development version packaged as an archive, get it at {{MW alpha branch link}} (GitHub).</translate>
<translate>
===…doesn't this work? It works on Wikipedia!=== <!--T:571-->
</translate>
<translate><!--T:572--> Wikipedia and other Wikimedia web sites use the current version of the code in development; at present, this is MediaWiki {{CURRENTVERSION}}, pulled from the current development branch.</translate>
<translate><!--T:573--> Coupled with the use of several extensions, this means that functionality between these wikis and your particular setup may differ.</translate>
<translate>
<!--T:574-->
*To obtain the current development code, read [[<tvar name=1>Special:MyLanguage/Download from Git</tvar>|Download from Git]]</translate>
<translate>
<!--T:575-->
*To check what version a Wikimedia wiki is running, as well as what extensions are installed, visit the <tvar name=1>[[Special:Version]]</tvar> page for that wiki</translate>
<translate>
<!--T:715-->
* You may also be missing several <tvar name=1>{{ll|Manual:Extensions|nsp=0}}</tvar> that are installed on Wikipedia, see [[<tvar name=2>#Templates imported from other wikis (such as Wikipedia) don't work for me</tvar>|#Templates imported from other wikis (such as Wikipedia) don't work for me]]
===…do I get a '''403 Forbidden''' error after setting permissions on my Fedora system?=== <!--T:576-->
</translate>
<translate><!--T:577--> Fedora enables <tvar name=1>{{ll|SELinux}}</tvar> by default.</translate>
<translate><!--T:578--> Instructions for setting SELinux permissions for MediaWiki [[<tvar name=1>Special:MyLanguage/SELinux</tvar>|are available]].</translate>
<translate>
===…do I get ''Installing some external dependencies (e.g. via composer) is required''?=== <!--T:686-->
</translate>
<translate><!--T:687--> Many hosting providers only handle zip archives, and we only provide gz compressed tar archives, thus the archives has to be recompressed before uploading.</translate>
<translate><!--T:688--> This should not be a hurdle, but it seems like some archive tools occasionally fail to include all files in large archives.</translate>
<translate><!--T:689--> When this happen the vendor folder is left out, leaving the user with the rather non-explanatory error message.</translate>
<translate>
<!--T:690-->
Use a command line tool when recompressing the tar archive into a zip archive.
===…do I get logged out constantly?=== <!--T:579-->
<!--T:580-->
This is probably related to cookies or session data. See [[<tvar name=1>Special:MyLanguage/Help:Logging in#Log in problems</tvar>|Log in problems]] for information.
<!--T:682-->
If this is happening constantly to all users, it probably means that caching is misconfigured. Setting <tvar name=1><code>$wgSessionCacheType = CACHE_DB;</code></tvar> can be used to determine if caching is the cause of the problem. If that solves the problem, you should still investigate what is wrong with your caching configuration.
===…is it a good idea to keep user accounts?=== <!--T:583-->
</translate>
{{outdated|1=<translate><!--T:716--> Manual edits to <tvar name=2><code>rev_user</code></tvar> fields in the database; MediaWiki uses the <tvar name=1>{{ll|Manual:actor table|actor}}</tvar> table now</translate>}}
<translate><!--T:584--> At many times you just want to remove a user account out of the wiki either because it belonged to a spammer account or you just feel like it.</translate>
<translate><!--T:585--> The appropriate choice is to block the account or rename it if needed.</translate>
<translate><!--T:586--> Here is why:</translate>
<translate>
<!--T:587-->
''Do I just remove this row from the <tvar name=1>{{ll|Manual:user table|user}}</tvar> table?''
<!--T:588-->
[[<tvar name=1>mailarchive:wikitech-l/2007-June/031566.html</tvar>|Rob Church posted the following]] regarding this issue on the wikitech-l mailing list:
</translate>
{{quote|text=
<translate><!--T:589--> If the user has made edits, then removing rows from the <tvar name=1><code>user</code></tvar> table cause theoretical loss of referential integrity.</translate>
<translate><!--T:590--> Now, to be honest with you, I can't think of any conditions where this would cause an actual problem; "undefined behaviour" is the phrase we use.</translate>
<translate>
<!--T:591-->
What I'd suggest doing, to be on the safe side, is running a couple of quick updates against the database:
</translate>
:<syntaxhighlight lang="sql">UPDATE revision SET rev_user = 0 WHERE rev_user = <current_user_id></syntaxhighlight>
:<syntaxhighlight lang="sql">UPDATE archive SET ar_user = 0 WHERE ar_user = <current_user_id></syntaxhighlight>
<translate>
<!--T:592-->
What this will do is cause MediaWiki to treat the revisions as having been made anonymously when generating things like page histories, which should eliminate any problems caused by these routines attempting to check user details from other tables.
<!--T:593-->
If the user has caused log entries, i.e. rows in the <tvar name=1><code>logging</code></tvar> table, or uploaded images, then the situation becomes trickier, as you'll have to start mopping up all the rows everywhere and it could become a bit of a mess, so if the user's done anything other than edit, I would strongly recommend just blocking them indefinitely.
<!--T:594-->
If the username is offensive or undesirable, then you could consider renaming it using the <tvar name=1>{{ll|Extension:Renameuser|RenameUser}}</tvar> extension.
</translate>
}}
<translate>
<!--T:595-->
Another option is to give Admins the <tvar name=1>{{ll|Manual:User rights|'hideuser'}}</tvar> right, and indefinitely block the user with the ''Hide username from edits and lists'' option selected.
<!--T:596-->
<tvar name=1>{{ll|Extension:UserMerge}}</tvar> is also useful.
===…is the number of pages so low on Special:Statistics?=== <!--T:699-->
</translate>
<translate><!--T:700--> [[<tvar name=1>phab:source/mediawiki/browse/master/includes/DefaultSettings.php</tvar>|By default]], <tvar name=2>{{ll|Manual:$wgArticleCountMethod|$wgArticleCountMethod}}</tvar> is set to <tvar name=3><code>link</code></tvar>.</translate>
<translate><!--T:701--> This means the number of "Content pages" on the <tvar name=1>[[Special:Statistics]]</tvar> page only counts pages which include at least one internal link.</translate>
<translate><!--T:702--> This can be changed by setting <tvar name=1>{{phpi|$wgArticleCountMethod}}</tvar> to <tvar name=2><code>any</code></tvar>.</translate>
<translate><!--T:703--> Afterwards, run <tvar name=1>{{ll|Manual:UpdateArticleCount.php|updateArticleCount.php}}</tvar> and/or <tvar name=2>{{ll|Manual:InitSiteStats.php|initSiteStats.php}}</tvar>.</translate>
<translate><!--T:704--> (On Wikimedia websites, <tvar name=1><code>initSiteStats.php</code></tvar> is run on the 1st and 15th of each month.)</translate>
<translate><!--T:705--> There might still be wrong behavior, see for example <tvar name=1>[[phab:T212706]]</tvar>.</translate>
<translate>
==Anti-spam== <!--T:597-->
===How do I use $wgSpamRegex to block more than one string?=== <!--T:601-->
</translate>
<translate><!--T:602--> <tvar name=1>{{ll|Manual:$wgSpamRegex|$wgSpamRegex}}</tvar> is a powerful filter for page content.</translate>
<translate><!--T:603--> Adding multiple items to the regex, however, can be awkward.</translate>
<translate><!--T:604--> Consider this snippet:</translate>
<syntaxhighlight lang="php">
$wgSpamRegexLines[] = 'display\s*:\s*none';
$wgSpamRegexLines[] = 'overflow\s*:\s*auto';
[...]
$wgSpamRegex = '/(' . implode( '|', $wgSpamRegexLines ) . ')/i';
</syntaxhighlight>
<translate><!--T:605--> This example code allows convenient addition of additional items to the regex without fiddling about each time.</translate>
<translate><!--T:606--> It also demonstrates two popular filters, which block some of the most common spam attacks.</translate>
:''<translate><!--T:711--> See also:</translate>'' {{ll|Extension:SpamRegex}}
<translate>
===Are there additional ways to fight spam?=== <!--T:608-->
<!--T:609-->
See <tvar name=1>'''{{ll|Manual:Combating spam}}'''</tvar> for an overview of anti-spam measures such as Captcha, content filtering and restricting edition.
==Anti-vandalism== <!--T:610-->
<!--T:611-->
See <tvar name=1>'''{{ll|Manual:Combating vandalism}}'''</tvar> for hints and suggestions on how to deal with wiki vandalism.
==Where now?== <!--T:612-->
===I've found a bug or have a feature request. Where do I post it?=== <!--T:613-->
</translate>
<translate><!--T:614--> Bugs and feature requests should be posted on <tvar name=1>{{ll|Phabricator}}</tvar>.</translate>
<translate><!--T:615--> See [[<tvar name=1>Special:MyLanguage/How to report a bug</tvar>|How to report a bug]].</translate>
<translate>
===I'm getting a strange error. What now?=== <!--T:616-->
<!--T:617-->
*See if it is covered by <tvar name=1>{{ll|Manual:Errors and Symptoms}}</tvar></translate>
<translate>
<!--T:618-->
*Try to find out more about the problem, see <tvar name=1>{{ll|Manual:How to debug}}</tvar></translate>
<translate>
<!--T:619-->
*See the [[<tvar name=1>#Still no luck. Where can I ask for help?</tvar>|section below]] for information on how to contact [[<tvar name=2>Special:MyLanguage/Developers</tvar>|developers]] and other knowledgable users.
=== I tried that but it didn't work === <!--T:621-->
</translate>
:''<translate><!--T:622--> I had a problem, I came to this page and it told me how to fix it.</translate> <translate><!--T:623--> But it didn't work, the problem is still there!!!!</translate>''
<translate><!--T:624--> Nine times out of ten this is because you didn't [[<tvar name=1>#How do I purge a cached page?</tvar>|clear your cache]].</translate>
<translate><!--T:625--> The simple test for this is to request a page that hasn't been requested before.</translate>
<translate><!--T:626--> Select the part of the URL in the address bar that contains the page title (e.g. Main_Page).</translate>
<translate><!--T:627--> Twiddle your fingers on the keyboard for a while, hit enter.</translate>
<translate><!--T:628--> Check if the problem is on that page too.</translate>
<translate><!--T:629--> MediaWiki uses both a server-side cache and a client-side cache, so clearing your browser cache is often not enough.</translate>
<translate><!--T:630--> See the [[<tvar name=1>#How do I purge a cached page?</tvar>|relevant entry above]] for more details.</translate>
<translate>
<!--T:631-->
Here are some other things to check:
<!--T:632-->
* Were you editing the right file? Try inserting some garbage into the file you edited, does it break anything?</translate>
<translate>
<!--T:633-->
** A great debugging tool in this case is to create a file called phpinfo.php, containing only <tvar name=1><syntaxhighlight lang=html inline><?php phpinfo() ?></syntaxhighlight></tvar>.</translate> <translate><!--T:634--> Upload it into your web directory and invoke it with your browser.</translate> <translate><!--T:635--> Check the document root and the path to php.ini.</translate>
<translate>
<!--T:636-->
* Were you editing the right part of the file?</translate> <translate><!--T:637--> Did you create a duplicate entry in php.ini?</translate> <translate><!--T:638--> Add new settings to the end of <tvar name=1><code>LocalSettings.php</code></tvar>, not to the beginning.</translate>
<translate>
<!--T:639-->
* If you created a .htaccess, are you sure AllowOverrides is on?</translate> <translate><!--T:640--> Ask your hosting provider.</translate>
<translate>
===I have a question not answered here. Where do I go next?=== <!--T:641-->
<!--T:642-->
If you've exhausted the FAQ above, please try the following:
<!--T:643-->
*Check the [[<tvar name=1>Special:MyLanguage/Project:Help</tvar>|other sources of help]] on this site</translate>
<translate>
<!--T:644-->
*[[<tvar name=1>Special:Search</tvar>|Search]] the rest of this site</translate>
<translate>
<!--T:646-->
*Search the web</translate>
<translate>
<!--T:647-->
* [[<tvar name=1>Special:MyLanguage/How to become a MediaWiki hacker</tvar>|Dig into the source]]</translate>
<translate>
<!--T:648-->
*See the [[<tvar name=1>#Still no luck. Where can I ask for help?</tvar>|section below]] for information on how to contact developers and other knowledgeable users.
===Still no luck. Where can I ask for help?=== <!--T:649-->
<!--T:770-->
See the support venues listed on <tvar name=1>{{ll|Communication}}</tvar>.
===See also=== <!--T:771-->
</translate>
*{{ll|Books about MediaWiki}}
[[Category:Manual{{#translation:}}]]
[[Category:Configure{{#translation:}}]]

2025年5月24日 (六) 12:02的最新版本

入门

The basics

What are the differences between MediaWiki, Wikimedia, Wikipedia, and wiki?

Please see <tvar name=1>模板:Ll</tvar> for a detailed answer.

I want to use a MediaWiki instance to (blank). Am I allowed to?

</translate> <translate> MediaWiki is free software: this means that you may use it for any purpose without legal hindrance.</translate> <translate> Furthermore, its licensing conditions apply solely to the software itself.</translate> <translate> This means that although many wikis license their content under a permissive license, you are not obliged to license the content submitted to your wiki in any particular way.</translate> <translate> Of course, as a project founded to support sites like Wikipedia, we encourage you to license the texts you write under a free license, but, in short, you are not required to.</translate>

<translate> If you wish to alter or amend the software itself, in general, you are permitted to, but there are some restrictions and you should consult [<tvar name=url>http://www.gnu.org/licenses/old-licenses/gpl-2.0.html</tvar> the full text of the GNU GPL version 2 for details].</translate> <translate> Because MediaWiki is provided free of charge, there is no warranty, to the extent permitted by applicable law.</translate>

<translate>

How do I create a wiki?

</translate> <translate> Creating a wiki implies installing MediaWiki on a server and having access to manage it.</translate> <translate> There are different options, depending on your level of expertise:</translate>

  • <translate> To create a wiki on your own server, follow the [[<tvar name=1>Special:MyLanguage/Manual:Installation guide</tvar>|Installation guide]].</translate>
  • <translate> Some hosts offer one-click installs, or allow creating a wiki on-request.</translate> <translate> See [[<tvar name=1>Special:MyLanguage/Hosting services</tvar>|Hosting services]] for different options.</translate>

<translate> This site (MediaWiki.org) or the Wikimedia Foundation does not allow individuals to create wikis.</translate>

模板:Anchor <translate>

Installation and configuration

Where do I download MediaWiki?

</translate> <translate> [[<tvar name=1>Special:MyLanguage/Download</tvar>|Download the latest stable release of MediaWiki.]] Files are supplied in a .tar.gz archive.</translate> <translate> MediaWiki can also be [[<tvar name=1>Special:MyLanguage/Download from Git</tvar>|obtained directly from our Git]] repository.</translate>

<translate>

How to install MediaWiki?

</translate> <translate> Installing MediaWiki takes around 10 to 30 minutes, and involves uploading/copying files, and running the installer script to configure the software.</translate> <translate> See <tvar name=1>模板:Ll</tvar>, where you will also find the minimum system requirements.</translate>

<translate>

How do I install MediaWiki using a package?

</translate> <translate> Many Linux distributions provide MediaWiki in a packaged format for that distribution.</translate> <translate> The MediaWiki development team refers you to your Linux distribution for assistance with installing, configuring or using them.</translate> <translate> The individual communities and companies who maintain such packages should provide installation instructions.</translate>

<translate> Be warned that third-party distributions may be older versions, so pay close attention to compatibility information for directions and extensions.</translate>

<translate> See also:</translate> 模板:Ll

<translate>

Can I install more than one wiki on a server using MediaWiki?

It is possible to install more than one wiki on a server provided that:

  • You install multiple instances of MediaWiki (such as with a [[<tvar name=1>Special:MyLanguage/software bundles#MediaWiki pre-integrated with AMP packages</tvar>|software bundle]] like the Bitnami MediaWiki Stack); in different directories – one for each wiki

Or

  • You use a different database for each wiki

Or

  • You use a different database prefix for each wiki (for Postgres, you can achieve a similar effect by using different schemas and users).</translate> <translate> If you want to use the same <tvar name=1>LocalSettings.php</tvar> file for both, you must ensure <tvar name=2>$wgServer</tvar> is dynamically set to the correct value.</translate>

<translate> For information on the latter two options, see <tvar name=1>模板:Ll</tvar> and <tvar name=2>模板:Ll</tvar> respectively.

For more information on setting up a wiki family (wikifarm), see <tvar name=1>模板:Ll</tvar>.

How do I install an existing wiki, like Wikipedia or Wiktionary?

The main (but not necessarily the easiest) method is to import. See [[<tvar name=1>#Wiki importing</tvar>|Wiki importing]], below.

(Non-MediaWiki methods, such as Xowa and Kiwix can be found at w:Wikipedia:Database download).

Does MediaWiki require shell access?

</translate> <translate> Shell access (SSH) is not required for installing MediaWiki, but it is highly recommended.</translate> <translate> Without shell access, it may even be difficult for you to get a backup of your wiki, or to upgrade to a new version.</translate> <translate> Some maintenance tasks are not possible at all without shell access.</translate> <translate> Many major extensions work best with shell access.</translate>

<translate>

How do I install extensions?

</translate> <translate> See <tvar name=1>模板:Ll</tvar> for information about installing and writing extensions.</translate> <translate> See <tvar name=1>模板:Ll</tvar> to find existing extensions.</translate>

<translate>

How do I add extra namespaces?

See [[<tvar name=1>Special:MyLanguage/Manual:Using custom namespaces#Creating a custom namespace</tvar>|Creating a custom namespace]].

How do I enable uploading?

</translate> <translate> File uploads are an often-used feature of MediaWiki, but are disabled by default in all current release versions.</translate> <translate> To enable them, first make the upload directory (default <tvar name=1>images</tvar>) writable by the web server (chmod -R 777 ./images or allow the Apache user to write to it, etc.) then set <tvar name=2>模板:Ll</tvar> to <tvar name=3>true</tvar> in <tvar name=4>LocalSettings.php</tvar>.</translate> <translate> If you get a "failed to mkdir" error when you try to upload, it probably means that there's a permissions problem.</translate>

<translate> See also:</translate> 模板:Ll

<translate>

How do I allow uploading of additional formats?

</translate> <translate> MediaWiki requires that allowed file upload formats are specified using the <tvar name=1>模板:Ll</tvar> configuration directive.</translate> <translate> Usually this directive is situated in <tvar name=1>LocalSettings.php</tvar> in the root of your MediaWiki installation.</translate>

<translate> For example, to extend uploading to PDF files, add the following to <tvar name=1>LocalSettings.php</tvar>:</translate>

<syntaxhighlight lang="php"> $wgFileExtensions[] = 'pdf'; </syntaxhighlight>

<translate> To extend uploading to more than one type of file, use the following syntax</translate>

<syntaxhighlight lang="php"> $wgFileExtensions = array_merge( $wgFileExtensions, [ 'pdf', 'txt', 'mp3' ] ); </syntaxhighlight>

<translate> See also:</translate> 模板:Ll

<translate>

How do I enable embedded math formulas?

</translate> <translate> MediaWiki allows embedded math formulas.</translate> <translate> See <tvar name=1>模板:Ll</tvar> for complete setup instructions.</translate>

<translate>

How do I set the timezone for my MediaWiki?

</translate>

<translate> See <tvar name=1>模板:Ll</tvar></translate>

<translate>

How do I purge a cached page?

To purge a cached page, such as when making changes to the navigation bar, add <tvar name=1>&action=purge</tvar> to the end of the page's dynamic URL. </translate>

<translate> E.g.</translate> https://www.mediawiki.org/w/index.php?title=Main_Page&action=purge

<translate> Or <tvar name=1>?action=purge</tvar> to the end of the page's short form URL:</translate>

<translate> E.g.</translate> https://www.mediawiki.org/wiki/Main_Page?action=purge

<translate> See also:</translate> 模板:Ll, 模板:Ll

<translate>

How do I completely disable caching?

Add in your <tvar name=1>LocalSettings.php</tvar> file the following lines: </translate>

模板:Ll = CACHE_NONE; 模板:Ll = false;

<translate>

"File is corrupt or has an invalid extension"

</translate> <translate> Some users have reported that after adding a file format to the allowed extensions list, an error is encountered.</translate> <translate> The text of the error is similar to the following:</translate>

<translate> The file is corrupt or has an incorrect extension. Please check the file and upload again.</translate>

<translate> As a possible solution, set the value of <tvar name=1>模板:Ll</tvar>. Under Unix or Linux, this would be</translate> <syntaxhighlight lang="php">$wgMimeDetectorCommand = "file --brief --mime";</syntaxhighlight>

<translate> See also:</translate> 模板:Ll

模板:Anchor <translate>

Initial user was not created by installer or it is not an administrator

</translate> <translate> Sometimes, the installer fails to create the default user, or the <tvar name=1>user</tvar> table is lost for some reason.</translate> <translate> There are a couple of options for solving this:</translate>

maintenance/createAndPromote.php

<translate>

  • Execute {{<tvar name=1>tmpl|0=模板:Ll --username <$1> --password <$2></tvar>|new user name|password for that user}} from the shell.</translate> <translate> Append <tvar name=1>--bureaucrat</tvar> to command line if you want that user to become a bureaucrat, in addition to becoming an administrator.</translate>

<translate> This will create a new user and promote them to an administrator.</translate> <translate> For help, run the script with the parameter <tvar name=1>--help</tvar>.</translate>

<translate>

Alter the database

  • Register a new account using the regular method (<tvar name=1>Special:UserLogin</tvar>).</translate>

<translate>

  • Check the user ID [[<tvar name=1>Special:MyLanguage/API:Userinfo#Example</tvar>|via API]].</translate>

<translate>

  • Execute the following SQL statement against the database:</translate>
    • INSERT INTO user_groups ( ug_user, ug_group ) VALUES ( <id>, 'bureaucrat' ), ( <id>, 'sysop' );
<translate> <tvar name=1><id></tvar> above should be replaced with the appropriate user ID which you can see on the user's preference page.</translate>
<translate> Note: if <tvar name=1>模板:Ll</tvar> is defined in <tvar name=2>LocalSettings.php</tvar>, prepend its value to the table name.</translate> <translate> For example, if <tvar name=1>模板:Phpi</tvar> is "XYZ", then the table name to use is XYZuser_groups</translate>

<translate>

Temporarily let everyone assign rights to promote your initial user

</translate> 模板:Warning

<translate> This method essentially involves letting all users temporarily modify user permissions in order to promote one user

  • Register a new account using the regular method (<tvar name=1>Special:UserLogin</tvar>).</translate> <translate> Be logged in using that account.</translate>

<translate>

  • Add the following line to the bottom of <tvar name=1>LocalSettings.php</tvar></translate>
    • $wgGroupPermissions['user']['userrights'] = true;

<translate>

  • Go to <tvar name=1>special:userrights</tvar> and add the user you just created to the Administrator and Bureaucrat groups.</translate>

<translate>

  • Remove the <tvar name=1><syntaxhighlight lang=php inline>$wgGroupPermissions['user']['userrights'] = true;</syntaxhighlight></tvar> line from your <tvar name=2>LocalSettings.php</tvar>.</translate> <translate> This step is very important, as until you remove it anyone can alter permissions, which is bad.</translate>

<translate>

How do I reset a user's MediaWiki password?

</translate>

<translate> See <tvar name=1>模板:Ll</tvar></translate>

<translate>

</translate>

<translate> See <tvar name=1>模板:Ll</tvar></translate>

<translate>

How do I make my base URLs shorter?

</translate>

<translate> (i.e. <tvar name=1>/wiki/Article_Name</tvar> as opposed to /w/index.php?title=Article_Name)</translate>

<translate> See <tvar name=1>模板:Ll</tvar></translate>

<translate>

How do I organize pages into subdirectories like /wiki/subdir/PageName?

</translate>

<translate> See <tvar name=1>模板:Ll模板:Int模板:Int模板:Ll</tvar></translate>

<translate>

Is downloading and using all of MediaWiki.org free?

</translate> <translate> Yes, it is free in the sense of Free software.</translate> <translate> See <tvar name=1>模板:Ll</tvar> for licensing issues regarding the written content of this site.</translate>

模板:Anchor <translate>

How do I administrate/manage user rights?

</translate>

<translate> See <tvar name=1>模板:Ll</tvar> for general information.</translate> <translate> See <tvar name=1>模板:Ll</tvar> for methods and strategies for restricting access.</translate>

<translate>

How do I stop anonymous users from editing any page?

</translate> <translate> The recommended method is by changing the value of the <tvar name=1>模板:Ll</tvar> configuration option.</translate> <translate> Edit <tvar name=1>模板:Ll</tvar> and add the line:</translate>

<syntaxhighlight lang="php"> $wgGroupPermissions['*']['edit'] = false; </syntaxhighlight>

<translate> If you use <tvar name=1>模板:Ll</tvar>, any admin can also disable IP editing temporarily as needed.</translate>

<translate> See also:</translate> 模板:Ll, 模板:Ll

<translate>

How do I stop anonymous users from reading any page?

  • Add this to the bottom of <tvar name=1>LocalSettings.php</tvar>:

</translate>

<syntaxhighlight lang="php"> $wgGroupPermissions['*']['read'] = false; </syntaxhighlight>

<translate> See also <tvar name=1>模板:Ll</tvar>.</translate> <translate> See [[<tvar name=1>Special:MyLanguage/Manual:Preventing access#Restrict viewing of all pages</tvar>|Manual:Preventing access#Restrict viewing of all pages]] for more information.</translate>

<translate>

How do I restrict account creation?

  • Add this to the bottom of <tvar name=1>LocalSettings.php</tvar>:

</translate>

<syntaxhighlight lang="php"> $wgGroupPermissions['*']['createaccount'] = false; </syntaxhighlight>

<translate> See [[<tvar name=1>Special:MyLanguage/Manual:Preventing access#Restrict account creation</tvar>|Manual:Preventing access#Restrict account creation]] for more information.

How do I require an email address be specified at registration?

</translate>

<translate> See <tvar name=1>模板:Ll</tvar></translate>

<translate>

How do I put MediaWiki into Read Only mode?

</translate>

模板:MW 1.5

<translate> See <tvar name=1>模板:Ll</tvar></translate>

<translate>

How do I change default user preferences?

</translate> 模板:MW 1.4 <translate> The MediaWiki default user preferences are in <tvar name=1>模板:Ll</tvar></translate> <translate> Don't edit that file, just use it for reference. </translate>

<translate> Say if you want to hide minor edits in recent changes by default.</translate> <translate> <tvar name=1>MainConfigSchema.php</tvar> says:</translate>

<syntaxhighlight lang=php> public const DefaultUserOptions = [

       ...

'hideminor' => 0,

       ...

] </syntaxhighlight>

<translate> To change the preference, put this in your <tvar name=1>LocalSettings.php</tvar>:</translate>

<syntaxhighlight lang=php> $wgDefaultUserOptions["hideminor"] = 1; </syntaxhighlight>

<translate> To change the default namespaces to be searched, in any version of MediaWiki, set <tvar name=1>模板:Ll</tvar> in <tvar name=2>LocalSettings.php</tvar> to an array mapping namespace indexes to boolean values.</translate> <translate> For example, to search the main namespace and the category namespace, use:</translate>

<syntaxhighlight lang=php> $wgNamespacesToBeSearchedDefault = [

   NS_MAIN => true,
   NS_CATEGORY => true,

]; </syntaxhighlight>

<translate> In some cases, after you change a default user preference, you may also want to change the user preferences of all existing user accounts. </translate>

<translate> If so, use the <tvar name=1>模板:Ll</tvar> script in the <tvar name=2>maintenance</tvar> directory.</translate> <translate> Use the <tvar name=1>--dry</tvar> option for the first run, assess the impact and go from there. (<tvar name=1>--dry</tvar> does not write the database.)</translate>

php userOptions.php --dry --nowarn hideminor --old 0 --new 1

<translate> Also, always backup your database before making these kinds of changes (you do not need to if you are just using <tvar name=1>--dry</tvar>).</translate>

<translate> See also:</translate> 模板:Ll

<translate>

How can I make MediaWiki run faster?

</translate>

<translate> See:</translate> 模板:Ll

<translate>

How do MediaWiki and GDPR go together?

</translate>

<translate> See <tvar name=1>GDPR (General Data Protection Regulation) and MediaWiki software</tvar></translate>

<translate>

Upgrading

</translate>

<translate> See <tvar name=1>模板:Ll</tvar></translate>

<translate>

Moving

Is it possible to move my wiki to a different machine?

</translate> <translate> Yes.</translate> <translate> It should be.</translate> <translate> In essence, you will be backing up your old installation and then "restoring" it onto the new machine.</translate> <translate> Finally, you will have to make additional modifications to update the wiki configuration so that everything points to the new location.</translate>

<translate>

How do I move my wiki to a different server?

Follow the instructions at <tvar name=1>模板:Ll</tvar>.

Changing the interface

How do I change the logo?

</translate> 模板:Caution 模板:Tip 模板:Note

<translate> The logo that appears in the top left of each page is determined by the <tvar name=1>模板:Ll</tvar> configuration line in the <tvar name=2>模板:Ll</tvar> file.</translate> MediaWiki installations prior to MediaWiki 1.35.0, used 模板:Ll.

<translate> There are two ways to change the logo: </translate>

  1. <translate> Upload a picture to your wiki using the normal file uploading interface.</translate> <translate> This allows the logo to be replaced easily, so you may want to protect the page if you use this method.</translate>
    <translate> The resulting logo path will be <tvar name="1"><syntaxhighlight lang="php">"{$wgUploadPath}/6/62/mylogo.png";</syntaxhighlight></tvar></translate>
  2. <translate> Upload a logo image to your server by other means (such as FTP).</translate>
    <translate> The resulting logo URL will be <tvar name="1"><syntaxhighlight lang="php">"{$wgScriptPath}/mylogo.jpg";</syntaxhighlight></tvar></translate>
    <translate> (In this example, the image is in the same folder as the <tvar name=1>LocalSettings.php</tvar> file.)</translate>

<translate> Then, modify the <tvar name="1">模板:Wg</tvar> array in <tvar name=2>LocalSettings.php</tvar>.</translate> <translate> It should look something like:</translate>

<syntaxhighlight lang="php"> $wgLogos = [ '1x' => "$wgResourceBasePath/resources/assets/change-your-logo.svg" 'icon' => "$wgResourceBasePath/resources/assets/change-your-logo-icon.svg" ]; </syntaxhighlight>

<translate> Replace the paths above with the appropriate new logo path.

If you only want to change the logo on specific pages, override #p-logo CSS's background-image property or use a third-party extension like <tvar name=1>模板:Ll</tvar>.

How do I edit the wiki's CSS?

</translate> <translate> You shouldn't edit the CSS files (such as <tvar name=1>common.css</tvar>) directly, because it will make upgrading harder if you need to apply your customizations each time you upgrade the software.</translate> <translate> Instead you need to edit a wiki page called <tvar name=1>MediaWiki:Common.css</tvar> if you want to apply your CSS changes for all skins, or a wiki page called <tvar name=2>MediaWiki:Vector.css</tvar> if you want to apply the customizations only for the Vector skin.</translate>

<translate> The content of the MediaWiki:Common.css and MediaWiki:Vector.css pages always overrides the default CSS styles specified in the skin files.

How do I hide the left vertical navigation toolbar?

In other words, how do you make the main content div take up 100% of the display, hiding the logo, toolbox, navigation and search engine?

To hide it permanently, copy and paste the following into the <tvar name=1>MediaWiki:Common.css</tvar> page: </translate>

<syntaxhighlight lang="css">

  1. column-content { margin: 0 0 .6em 0; }
  2. content { margin: 2.8em 0 0 0; }
  3. p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search { display:none; }
  4. p-cactions { left: .1em; }

</syntaxhighlight>

<translate> To instead hide the toolbar when the user presses F11, enter this in your wiki's <tvar name=1>MediaWiki:Common.js</tvar>:</translate>

<syntaxhighlight lang="javascript"> document.onkeydown = function( e ) { if( e == null ) e = event if( testKey( e, 122 ) ) { //F11 appendCSS('#column-content {margin: 0 0 .6em 0;} #content {margin: 2.8em 0 0 0;} #p-logo, .generated-sidebar, #p-lang, #p-tb, #p-search {display:none;} #p-cactions {left: .1em;} #footer {display:none;}'); return false; } }

function testKey( e, intKeyCode ) { if( window.createPopup ) return e.keyCode == intKeyCode else return e.which == intKeyCode } </syntaxhighlight>

<translate>

How do I hide the categories at the bottom of each page?

You can hide display of the categories on each page by modifying your <tvar name=1>MediaWiki:Common.css</tvar> and adding: </translate>

<syntaxhighlight lang="css">.catlinks { display: none; }</syntaxhighlight>

<translate>

</translate> <translate> By default, clicking the site-logo takes you to the main site-page.</translate> <translate> If you want to change which internal site-page is the "main" site-page, edit <tvar name=1>MediaWiki:Mainpage</tvar>.</translate>

<translate> To make the link of the site-logo link externally to any other arbitrary URL, you can use jQuery code within <tvar name=1>MediaWiki:Common.js</tvar>: </translate>

<syntaxhighlight lang=javascript> $("a.mw-wiki-logo").attr("href", "http://www.example.com"); $("a.mw-wiki-logo").attr("title", "<translate nowrap> Go to <tvar name=1>example.com</tvar> website</translate>"); </syntaxhighlight>

<translate>

How do I change the icon in the browser's address line (favicon)?

  • Simply upload your favicon.ico to the root of your domain/subdomain, make sure file name is in lower case and its name is favicon.ico</translate>

<translate>

  • Alternatively edit the <tvar name=1>模板:Ll</tvar> setting in <tvar name=2>LocalSettings.php</tvar> and add</translate> <syntaxhighlight lang=php inline>$wgFavicon = "$wgScriptPath/path/to/your/favicon.ico";</syntaxhighlight>

<translate> See <tvar name=1>模板:Ll</tvar> for more details.

Tip: The favicon image should be either 16 x 16 pixels or 32 x 32 pixels.

Rewrite Rule

</translate> <translate> If you are using a rewrite rule in .htaccess to remove "index.php" from the URL, you will also need to add an exception for .ico files.</translate> <translate> Simply add the following rule to your .htaccess:</translate>

<syntaxhighlight lang="apacheconf">RewriteRule .*\.ico$ - [L]</syntaxhighlight>

<translate> This rule must appear before the index.php rule.

Case sensitivity

</translate> <translate> When uploading the favicon file, be sure the filename is in lowercase. (That is, "favicon.ico", not "Favicon.ico".)</translate> <translate> A lot of servers (e.g., those on UNIX-like operating systems) will not be able to find the file unless its name is in lowercase.</translate>

<translate>

How do I customize the navigation bar?

</translate> <translate> The contents of the navigation bar which appears to the left of each page using the Vector or the Monobook skin are determined by the <tvar name=1>MediaWiki:Sidebar</tvar> page there on your wiki.</translate> <translate> For information on customising these, please see <tvar name=1>模板:Ll</tvar>.</translate>

<translate>

How do I put a text message (sitenotice) on every page?

Put a text in the <tvar name=1>MediaWiki:Sitenotice</tvar> page. It will be displayed on top of every article page. </translate>

<translate> You can also add text to <tvar name=1>MediaWiki:Anonnotice</tvar> to create a message that only displays for logged-out users.</translate> <translate> It is often a good idea to transclude the site notice on the anon notice to make sure that logged-out users still get the information on the site notice.</translate>

<translate>

How do I change which page is the main page?

</translate> <translate> By default, MediaWiki looks for a page with the title Main Page and serves this as the default page.</translate> <translate> This can be changed by altering the contents of <tvar name=1>模板:Ll</tvar> to point to a different title.</translate> <translate> If this does not change the 'Main Page' link included on the sidebar at install time, edit <tvar name=1>模板:Ll</tvar>.</translate>

<translate>

How do I change the Main Page title?

Simply click on the "Move" tab, and move the page to the desired page title.

Usually you also want to [[<tvar name=1>#How do I change which page is the main page?</tvar>|change which page is the configured as "main page"]].

How do I hide the main page title?

The displayed title of the main page can be changed using the MediaWiki messages <tvar name=1>模板:Blue</tvar> and <tvar name=2>模板:Blue</tvar> (for logged-out and logged-in users respectively). The main page title can be hidden by setting both messages to empty (or only either of them if the title should still be displayed to logged-out or logged-in users).

How can I hide the table of contents?

</translate> <translate> The table of contents (TOC) is automatically shown once there are four or more headings in the article.</translate> <translate> There are multiple ways to hide it.</translate>

<translate> For one page</translate>
<translate> Place the magic word <tvar name=1>__NOTOC__</tvar> in the page's wikitext.</translate>
<translate> For all pages</translate>
<translate> Install <tvar name=1>模板:Ll</tvar></translate>
<translate> or</translate>
<translate> Add the following rule to <tvar name=1>MediaWiki:Common.css</tvar>:</translate> <syntaxhighlight lang="css">.toc, #toc { display: none; }</syntaxhighlight>
<translate> Per user</translate>
<translate> Users can add the same CSS rule to their <tvar name=1>common.css</tvar> [[<tvar name=2>Special:MyLanguage/Manual:Interface/Stylesheets</tvar>|personal stylesheet]].</translate>

<translate>

How do I change the interface text?

</translate> <translate> Interface text is altered using the MediaWiki namespace.</translate> <translate> For each deviation from the default in the site language there is a page MediaWiki:Englishmessagename, and for each deviation from the default in each other language a page MediaWiki:Englishmessagename/languagecode.</translate> <translate> (Since release 1.9 there are no pages for messages equal to the default.).</translate> <translate> On creation of a page the edit box autofills with the default.</translate> <translate> When creating a page to override the default it is useful to first save the default version, to allow diffs with it.</translate> <translate> See also <tvar name=1>模板:Ll</tvar>.</translate>

<translate>

<translate>

  • To switch off the MediaWiki namespace, see the <tvar name=1>模板:Ll</tvar> configuration setting</translate>

<translate>

  • To remove the Privacy policy or Disclaimers links at the bottom of each page, set the content of pages <tvar name=1>MediaWiki:Privacy</tvar> or <tvar name=2>MediaWiki:Disclaimers</tvar> respectively to a single hyphen (-).

How do I edit error messages?

<tvar name=1>Special:Allmessages</tvar> contains a complete list of messages (error or otherwise), that can be edited.

You may also add <tvar name=1>?uselang=qqx</tvar> or <tvar name=2>&uselang=qqx</tvar> to a URL which will display the name of each messages in the interface.

How do I change the interface language?

To change the default interface language, alter the value of <tvar name=1>模板:Ll</tvar> in <tvar name=2>LocalSettings.php</tvar>, for example </translate>

<syntaxhighlight lang="php"> $wgLanguageCode = "fr"; </syntaxhighlight>

<translate> You may also need to bypass your browser's cache to see the changes.

The new default interface language will be applied to all users who haven't ever customised it.

If you want to provide users the possibility to create and choose pages and interface elements in languages other than the default one of the wiki, you need the <tvar name=1>模板:Ll</tvar> extension, which can make your wiki multilingual. </translate>

<translate> If you want to change the language settings for all existing users, use the <tvar name=1>模板:Ll</tvar> [[<tvar name=2>Special:MyLanguage/Manual:Maintenance scripts</tvar>|maintenance script]].</translate> <translate> For instance, to have all users with English set use French instead, run:</translate>

<syntaxhighlight lang="php"> php userOptions.php language --old en --new fr </syntaxhighlight>

<translate>

How do I remove the article/edit etc tabs?

For a little more control see: <tvar name=1>User:Subfader/Hide_page_tabs</tvar>

Edit <tvar name=1>MediaWiki:Common.css</tvar> on your wiki, and add this:</translate>

<syntaxhighlight lang="css">li#ca-edit { display: none; }</syntaxhighlight>

<translate> See the page source for the various #ca-* ids used in the content tabs.</translate>

模板:Note

<translate>

How do I add/remove tabs throughout my wiki?

See <tvar name=1>模板:Ll</tvar>

How do I remove a tab on only one page?

</translate> 模板:MW 1.9 <translate> For example, to remove the Discussion (talk) page tab from the Main Page, on the <tvar name=1>MediaWiki:Common.css</tvar> page add:</translate> <syntaxhighlight lang="css"> body.page-Main_Page li#ca-talk { display: none !important; } </syntaxhighlight>

<translate> To modify <tvar name=1>MediaWiki:Common.css</tvar> you must be an <tvar name=2>模板:Ll</tvar>.</translate>

<translate> See also:</translate> 模板:Ll

<translate>

How do I remove a tab on all pages

</translate> 模板:MW 1.9 <translate> For example, to remove the Discussion (talk) page tab on all wikipages, on the <tvar name=1>MediaWiki:Common.css</tvar> page add:</translate>

<syntaxhighlight lang="css">

  1. ca-talk { display:none!important; }

</syntaxhighlight>

<translate> Other tabs to remove are #ca-history, #ca-viewsource, #ca-view (Read tab), #ca-nstab-main (Page tab).

Other drop down menu items you can remove are #ca-watch, #ca-move, #ca-delete.

To modify <tvar name=1>MediaWiki:Common.css</tvar> you must be an <tvar name=2>模板:Ll</tvar>.

One option is to hide the link using the following CSS in the wiki page MediaWiki:Common.css in your wiki: </translate>

<syntaxhighlight lang="css">

  1. p-personal #pt-anonuserpage {
   display: none;

} </syntaxhighlight>

<translate>

To remove the login / create account links from the personal_urls you can use this code in your <tvar name=1>模板:Manual</tvar> to hook in and remove them: </translate>

<syntaxhighlight lang=php> $wgHooks['SkinTemplateNavigation::Universal'][] = function ( $skinTemplate, &$links ) { unset( $links['user-menu']['login'] ); unset( $links['user-menu']['login-private'] ); unset( $links['user-menu']['createaccount'] ); }; </syntaxhighlight>

<translate>

How can I suppress actions and special pages?

To disable a specific special page (such as Special:SpecialPages), you may use: </translate>

<syntaxhighlight lang="php"> $wgSpecialPages['<translate nowrap> Name</translate>'] = DisabledSpecialPage::getCallback( '<translate nowrap> Name</translate>', '<translate nowrap> message</translate>' ); </syntaxhighlight>

<translate> where Name is the canonical (English) name of the special page to disable, and message is the message to be shown to users when they try to access the special page.

To disable an action (such as edit), you may use: </translate>

<syntaxhighlight lang="php"> $wgActions['edit'] = false; </syntaxhighlight>

<translate> See <tvar name=1>模板:Ll</tvar> to disable an API module.

This is only the basic usages. Usually you may want to disable special pages, actions or API modules conditionally.

How do I change the footer?

</translate>

<translate> See:</translate> 模板:Ll, 模板:Ll

模板:Anchor <translate>

How can I edit / remove the Powered by MediaWiki image (and possible other images) from the footer?

You can hide the Powered by MediaWiki image by adding the following to your wiki's <tvar name=1>MediaWiki:Common.css</tvar>: </translate>

<syntaxhighlight lang="css">

  1. footer-poweredbyico { display: none; }

</syntaxhighlight>

<translate> If you want to remove it completely, you can use <tvar name=1>模板:Wg</tvar> to remove it using this in your <tvar name=2>模板:Manual</tvar>:</translate>

<syntaxhighlight lang=php>unset( $wgFooterIcons['poweredby'] );</syntaxhighlight>

<translate> Note that this will also remove other powered-by icons, e.g. also the one coming from BlueSpice.

If you wish to change the icon images, urls, alt text, or add new icons please see <tvar name=1>模板:Wg</tvar>' documentation.

Install <tvar name="1">模板:Ll</tvar> to enable automatic reply links on talk pages.

How can I change what the <tvar name=1>模板:Tag</tvar> of each page is? Where do I make changes?

Most of the text that you want to change can be found in the namespace of MediaWiki. </translate>

<translate> In order to change titles, texts, announcements, etc., go to <tvar name=1>Special:AllMessages</tvar>, where you will see the text associated with the pages you wish to change.</translate> <translate> You need to log in as an administrator to edit the protected entries in the MediaWiki namespace.</translate>

<translate> If you want to change the title in your browser, you need to edit <tvar name=1>MediaWiki:Pagetitle</tvar>.</translate> <translate> Go there and edit it just like you would any other page in your wiki.</translate>

<translate> In recent versions of MediaWiki, MediaWiki:Pagetitle is <tvar name=1>$1 - {{SITENAME}}</tvar> by default. If <tvar name=2>{{SITENAME}}</tvar> is producing the wrong text for you, you need to set <tvar name=3>模板:Ll</tvar> in your <tvar name=4>LocalSettings.php</tvar>.

Don't forget to clear your browser cache after you change your settings.

Does MediaWiki automatically capitalize the first letter of $wgSitename?

</translate> <translate> Yes.</translate> <translate> This can be changed using the <tvar name=1>模板:Ll</tvar> configuration setting.</translate>

<translate>

</translate>

<translate> See <tvar name=1>模板:Ll</tvar></translate>

<translate>

How can I suppress MediaWiki from formatting URLs, tags, etc?

Put "<tvar name=nowiki>模板:Tag</tvar>" tags around the URL or tag.

Example: </translate>

svn co <nowiki>http://svn.example.com/myproject/</nowiki>

<translate> Produces:</translate>
svn co http://svn.example.com/myproject/

<translate>

How can I force users to preview before they save?

</translate>

<translate> See:</translate> 模板:Ll, 模板:Ll

<translate>

How do I add more buttons on the edit page?

</translate>

<translate> See:</translate> 模板:Ll

<translate>

How can I get more special characters or tags clickable on the edit page?

For adding more selectable special characters, etc., below the edit field, see <tvar name=1>模板:Ll</tvar>.

How can I use a different skin on my wiki?

See <tvar name=1>模板:Ll</tvar> for more information on configuring your default skin.

Edit the page <tvar name=1>MediaWiki:Print.css</tvar> on your wiki and add the following code there: </translate>

<syntaxhighlight lang="css">

  1. content a.external.text:after,
  2. content a.external.autonumber:after {

content: none; } </syntaxhighlight>

<translate> This will override the styles defined in the CSS files coming with the MediaWiki source code.</translate> <translate> For more information, see <tvar name=1>模板:Ll</tvar>.</translate>

<translate> If instead you want to have the external links underlined in the printable version, then also add the following code:</translate>

<syntaxhighlight lang="css">

  1. content a.external {
   text-decoration: underline !important;

} </syntaxhighlight>

<translate>

How do I print footnotes at the bottom of each printed page?

Try this StackOverflow solution: [<tvar name=url>https://stackoverflow.com/a/23622470</tvar> Printed HTML per-page footnotes] </translate>

模板:Anchor <translate>

How do I change the text of the article (page name) tab of my wiki's main page?

To change the text of the tab, as one example used in Wikipedia, you first open the page "<tvar name=1>MediaWiki:Mainpage-nstab</tvar>". </translate>

<translate> After you've done that, click Edit and type in the edit box the text you want to be seen later on the main page - that's it.</translate> <translate> Don't forget to save the page as well.</translate>

<translate>

How do I change the background color?

To change the background color of the MediaWiki interface outside of the page content and tabs, add the following CSS to the MediaWiki page <tvar name=commoncss>[[MediaWiki:Common.css]]</tvar>: </translate>

<syntaxhighlight lang="css"> /* Changes the background color of the bottom and left of each page, up to behind half of the logo: */ body {

 background: red;

}

/* Changes the background color behind the top half of the logo and at top of each page: */

  1. mw-page-base {
 background: red;

} </syntaxhighlight>

<translate> This will change the background color outside of the tabs, search, and page content to red.</translate> <translate> See <tvar name=1>模板:Ll</tvar> for more information.</translate>

<translate>

How do I load external fonts?

</translate> <translate> This example refers to Google Fonts, a repository of free open-source fonts that you can use with MediaWiki.</translate> <translate> Go to <tvar name=link>https://fonts.google.com/</tvar>, find fonts that you like, and select them by clicking the "plus" (+) icon.</translate> <translate> Select one or more fonts to be added.</translate> <translate> Click the tab for the pop-up notification, and then select "@IMPORT". Copy and paste the resulting CSS into <tvar name=commoncss>[[MediaWiki:Common.css]]</tvar>. The examples below use Noto Sans and Noto Serif. They are default fonts for Android operating system and have good support for Unicode text.</translate>

<syntaxhighlight lang="css"> @import url( 'https://fonts.googleapis.com/css?family=Noto+Sans%7CNoto+Serif' );

/* Changes the default font used for MediaWiki to Noto Sans (does not include headings or monospaced text): */ body {

 font-family: "Noto Sans", sans-serif;

}

/* Changes the default font used for MediaWiki headings to Noto Serif: */

  1. content h1,
  2. content h2 {
 font-family: "Noto Serif", serif;

} </syntaxhighlight>

<translate>

How to hide the "Your edit was saved" notification?

</translate> <translate> Edit the wiki page <tvar name=1>MediaWiki:Common.css</tvar> on your wiki to include the line <tvar name=2>.postedit {display: none;}</tvar>.</translate> See 模板:Ll for more information.

<translate>

Basic usage

How do I edit a page?

</translate> <translate> To edit a page, simply click the edit link that appears on each page.</translate> <translate> Using the default Vector skin, this is in the form of a tab at the top of the page.</translate> <translate> A form will appear, containing the existing markup.</translate> <translate> When you have finished making modifications, click the Save button to commit your changes.</translate>

<translate> See also:</translate> 模板:Ll

<translate>

How do I create a new page?

There are several ways to create a new page:

  • Create a link to the page on another page, then click on the red link which appears</translate>

<translate>

  • Browse to the intended location of the page, e.g. http://www.example.com/index.php?title=New_page and click on the "Edit", "Create" or "Create source" link.

On some wikis, a failed search for a page will contain a link which allows you to edit that page. </translate>

<translate> See also:</translate> 模板:Ll

<translate>

How do I delete an old version of a page?

</translate> <translate> Old versions of page data are retained in the database and can be accessed via the page history features.</translate> <translate> This is useful for reviewing changes and correcting or reverting undesirable ones, but in some cases, administrators might want to make this information unavailable, for legal reasons, or to reduce the size of the database.</translate>

<translate>

  • Administrators can delete an old revision of a page by deleting the page, and then selectively undeleting revisions to be kept</translate>

<translate>

  • You can enable the core <tvar name=1>模板:Ll</tvar> feature that allows privileged users to remove single revisions from page histories.</translate>

<translate>

  • The <tvar name=1>maintenance/模板:Ll</tvar> [[<tvar name=2>Special:MyLanguage/Manual:Maintenance scripts</tvar>|maintenance script]] can mass-delete all old revisions of pages and their associated text records.

</translate>

<translate> See also:</translate> 模板:Ll

<translate>

How do I use oversight/delete revisions in the page history?

</translate>

<translate> See:</translate> 模板:Ll

<translate> You can also delete a page, and then restore only the revisions you want.

Are there any editing tutorials available?

</translate> <translate> There are several editing tutorials available, mostly on Wikimedia sister projects, such as Wikipedia.</translate> <translate> There are also markup references, etc. available on Meta.</translate>

<translate>

  • The page <tvar name=1>模板:Ll</tvar> on this site</translate>

<translate>

How do I view the printable form of a page?

</translate> 模板:See also <translate> MediaWiki includes stylesheets which automatically style a page appropriately when it is printed; using the print or print preview function within your browser ought to render the page in a printable form.

You can also view this printable form using the printable version link in the sidebar under Toolbox or Print/export if using the <tvar name=1>模板:Ll</tvar> extension.

How do I use templates?

</translate>

<translate> See <tvar name=1>模板:Ll</tvar></translate>

<translate>

Can I use media (images, video, audio, etc.) from [[<tvar name=1>m:Special:MyLanguage/Wikimedia Commons</tvar>|Wikimedia Commons]] in my installed version of MediaWiki?

Yes, this is encouraged through the use of <tvar name=1>模板:Ll</tvar>. </translate>

<translate> See also:</translate> 模板:Ll

<translate>

How do I use a template as a signature?

</translate> <translate> When you look at your preferences, you see a check box for "raw signature."</translate> <translate> But the field will only take a certain number of characters.</translate> <translate> What if you want more?</translate>

<translate> You will need to create two pages, possibly in your userspace.</translate>

  1. <translate> Create the first page (FIRST PAGE)</translate>
  2. <translate> Go to your preferences, check "raw signature" and put <tvar name=1>{{FIRST PAGE}}</tvar> in the signature.</translate> 模板:Int
  3. <translate> Create a second page (SECOND PAGE) (possibly a sub-page of the first)</translate>
  4. <translate> Go back to the first page (FIRST PAGE) and do <tvar name=1>{{SECOND PAGE}}</tvar></translate>
  5. <translate> Go to the second page (SECOND PAGE) and place the code you wish to have for your signature.</translate>

<translate> If you don't have this structure, you will still be inserting all your signature code into the raw code wherever your signature is used, because the software will insert "SUBST" in your preferences.</translate> <translate> You may not mind this, in which case you only need one page.</translate> <translate> If you want the raw code to only display <tvar name=1>{{FIRST PAGE}}</tvar>, which looks a lot cleaner, then you need to use the two-page structure.</translate>

<translate>

How do I add the sandbox functionality to my installation of the wiki?

</translate> <translate> In wiki terms, a sandbox is simply a "play pen"; a page which users can mess about in.</translate> <translate> This is an ordinary page created in the normal manner, and can be located wherever you like.</translate> <translate> There is no special sandbox functionality built into MediaWiki.</translate>

<translate> Users often inquire about the Wikipedia sandboxes, which seem to be self-emptying.</translate> <translate> This is not quite correct; there are a number of volunteers who run [[<tvar name=1>Special:MyLanguage/Manual:Bots</tvar>|bots]] to clean these up and return them to a certain state at regular time intervals.</translate>

<translate> See also <tvar name=2>模板:Ll</tvar> which will add a link to user's personal sandbox (i.e. a subpage of personal user page) to personal tools menu.

How do I make my wiki serve all languages?

</translate>

  • <translate> To allow user to switch the language of the interface, see <tvar name=1>模板:Ll</tvar></translate>
  • <translate> To allow translation of pages and of the custom interface (like the sidebar), use the <tvar name=1>模板:Ll</tvar> extension; there's [[<tvar name=2>Special:MyLanguage/Help:Extension:Translate</tvar>|extensive documentation]].</translate>

<translate>

Wiki importing

Importing from MediaWiki XML dumps

</translate>

<translate> See:</translate> 模板:Ll

<translate>

Importing from other types of wiki software

</translate> 模板:Main <translate>

Importing from other types of files

There are a variety of tools available to help convert content from HTML (and other formats) to MediaWiki markup. </translate>

<translate> Developer and SysAdmin tools</translate>
  • HTML::WikiConverter::MediaWiki – <translate> a Perl module for converting from HTML to MediaWiki markup.</translate>
  • Wikificator – <translate> a JavaScript MediaWiki extension that converts XHTML to MediaWiki markup.</translate>

<translate>

  • The <tvar name=1>模板:Ll</tvar> and <tvar name=2>模板:Ll</tvar> [[<tvar name=3>Special:MyLanguage/Manual:Maintenance scripts</tvar>|maintenance scripts]] can be used to import text and images into MediaWiki.</translate>
<translate> End-user tools</translate>

<translate>

  • wikEd – a text editor for MediaWiki that can import HTML (including Microsoft Word-generated HTML.)</translate>
<translate> Instructions</translate>

<translate>

<translate>

Templates imported from other wikis (such as Wikipedia) don't work for me

</translate> <translate> You probably need to install some extensions used on the source wiki, such as <tvar name=3>模板:Ll</tvar>, <tvar name=4>模板:Ll</tvar>, <tvar name=1>模板:Ll</tvar> or sometimes <tvar name=2>模板:Ll</tvar>.</translate> <translate> Also, make sure that you copied all [[<tvar name=1>Special:MyLanguage/Manual:Interface/Stylesheets</tvar>|site CSS]] and [[<tvar name=2>Special:MyLanguage/Manual:Interface/JavaScript</tvar>|JavaScript]] required by the template.</translate>

<translate>

Customising further

I want to have multiple wikis, but only require registration once

  • If you're starting from scratch or you're switching from one wiki to multiple, you can use <tvar name=1>模板:Ll</tvar> and <tvar name=2>模板:Ll</tvar> to have all wikis share the <tvar name=3>user</tvar> table of the "main" wiki.</translate> <translate> You can share other tables as well, as long as they don't contain any data dependent on non-shared tables or data specific to one wiki.</translate> <translate> See <tvar name=1>模板:Ll</tvar> for examples and more information.</translate>

<translate>

  • If your wikis are already established and you want to switch to a single sign-on, you can use the <tvar name=1>模板:Ll</tvar> extension.</translate> <translate> It has a few more features than a shared <tvar name=1>user</tvar> table, but it's more difficult to configure and it's tailored toward a Wikimedia-style setup.</translate> <translate> However, it is easier than attempting to completely merge multiple <tvar name=1>user</tvar> tables into one.</translate>

<translate>

How can I allow use of HTML tags?

See <tvar name=1>模板:Ll</tvar> as well as <tvar name=2>模板:Ll模板:Int模板:Int模板:Ll</tvar>. </translate>

模板:Caution

<translate> See <tvar name=1>模板:Ll</tvar> for ways to make this safer.

How do I fix problems or add features to MediaWiki?

The basic steps to improving MediaWiki (that is, [[<tvar name=1>Special:MyLanguage/How to become a MediaWiki hacker</tvar>|becoming a MediaWiki developer]]) are:

  • Install [[<tvar name=1>Special:MyLanguage/Gerrit</tvar>|Git]]</translate>

<translate>

  • Download the Git "clone" of the MediaWiki source code</translate>

<translate>

  • Get a server, a database, and PHP running on your computer (this can be annoying, so please ask for help if something isn't working)</translate>

<translate>

  • Get MediaWiki running on your computer off that Git checkout (can be annoying as well, so, ditto)</translate>

<translate>

  • Fix the problem or add the feature you were thinking of</translate>

<translate>

  • Edit the source code of the relevant file(s) to fix the problem</translate>

<translate>

How do I run a bot?

</translate>

<translate> See:</translate> 模板:Ll

<translate> You might want to use the <tvar name=1>模板:Ll</tvar> framework.</translate>

<translate>

How do I change noindex nofollow

Set <tvar name=code>模板:Ll = false;</tvar> in <tvar name=1>模板:Ll</tvar>

How do I add meta tags?

</translate> <translate> The OutputPage class includes an addMeta method which can be used to add meta tags.</translate> <translate> The <tvar name=1>模板:Ll</tvar> can be used to get the relevant OutputPage object.</translate>

<syntaxhighlight lang=php> $out->addMeta ( 'description', '<translate nowrap> This is a meta description.</translate>' ); </syntaxhighlight>

<translate>

Why...?

…is the Help namespace empty?

</translate> <translate> The Help namespace currently ships in a blank state.</translate> <translate> It's up to you how much or how little help you give to your site visitors and whether this relates to other aspects of your site.</translate> <translate> Obviously you can easily link your visitors to help resources elsewhere.</translate>

<translate> We don't currently have a clean, internationalised set of help pages under a free license.</translate> <translate> However, if you want to copy in some help information onto your site, about how to use a wiki (a MediaWiki powered wiki) you are free to copy the <tvar name=1>模板:Ll</tvar> from this wiki.</translate> <translate> This set of pages have been deliberately created for this purpose, with wiki-neutral information, and no license restrictions.</translate> <translate> See <tvar name=1>模板:Ll</tvar>.</translate>

<translate>

…are some of my images not showing up after an upgrade?

</translate> <translate> Several users have reported that, following an upgrade or a moving of their wiki, several images fail to be shown inline.</translate> <translate> The files exist, and the image description pages show a MIME type of <tvar name=1>unknowncode>/unknown</tvar> and, in some cases, a warning about potentially dangerous files.</translate>

<translate> To fix this, run the <tvar name=1>maintenance/rebuildImages.php</tvar> script from the command line.</translate> <translate> This will set MIME information for each file in the database.</translate>

<translate> MediaWiki 1.21 and newer implements [[<tvar name=1>Special:MyLanguage/Manual:$wgResponsiveImages</tvar>|responsive images]].</translate> <translate> Due to [[<tvar name=bug>phab:T181987</tvar>|a bug]], if the server locale is set to one that uses commas instead of dots for representing a decimal point, images may not render on some browsers/devices.</translate> <translate> This can be confirmed by inspecting a thumbnail of a medium or big image on a page with the browser tools, looking at the HTML code, and see if the <tvar name=1>srcset</tvar> attribute contains commas instead of dots when representing the <tvar name=2>1.5x</tvar> value.</translate>

<translate>

…are all PNG files not being turned into thumbnails?

</translate> <translate> After upgrading to a more recent version of PHP, it is possible a different MimeMagic.php function is being used to detect file MIME types, particularly the built-in PHP function mime_content_type, which fails to detect PNG files.</translate> <translate> Search the web for <tvar name=1>mime_content_type png</tvar> for information on fixing this bug at the PHP level, possibly by editing your magic.mime file.</translate>

<translate> See [[<tvar name=1>#"File is corrupt or has an invalid extension"</tvar>|File is corrupt or has an invalid extension]] for more info.

…can't I download MediaWiki <tvar name=1>{{#expr:模板:MW stable branch number+.01}}</tvar>?

</translate> <translate> MediaWiki <tvar name=1>{{#expr:模板:MW stable branch number+.01}}</tvar> is in a development state at present, and has not been packaged into a general release.</translate> <translate> The code can be [[<tvar name=1>Special:MyLanguage/Download from Git</tvar>|downloaded from Git]] if desired.</translate> <translate> Or, if you want the latest development version packaged as an archive, get it at 模板:MW alpha branch link (GitHub).</translate>

<translate>

…doesn't this work? It works on Wikipedia!

</translate> <translate> Wikipedia and other Wikimedia web sites use the current version of the code in development; at present, this is MediaWiki 1.45.0-alpha, pulled from the current development branch.</translate> <translate> Coupled with the use of several extensions, this means that functionality between these wikis and your particular setup may differ.</translate>

<translate>

  • To obtain the current development code, read [[<tvar name=1>Special:MyLanguage/Download from Git</tvar>|Download from Git]]</translate>

<translate>

  • To check what version a Wikimedia wiki is running, as well as what extensions are installed, visit the <tvar name=1>Special:Version</tvar> page for that wiki</translate>

<translate>

  • You may also be missing several <tvar name=1>模板:Ll</tvar> that are installed on Wikipedia, see [[<tvar name=2>#Templates imported from other wikis (such as Wikipedia) don't work for me</tvar>|#Templates imported from other wikis (such as Wikipedia) don't work for me]]

…do I get a 403 Forbidden error after setting permissions on my Fedora system?

</translate> <translate> Fedora enables <tvar name=1>模板:Ll</tvar> by default.</translate> <translate> Instructions for setting SELinux permissions for MediaWiki [[<tvar name=1>Special:MyLanguage/SELinux</tvar>|are available]].</translate>

<translate>

…do I get Installing some external dependencies (e.g. via composer) is required?

</translate> <translate> Many hosting providers only handle zip archives, and we only provide gz compressed tar archives, thus the archives has to be recompressed before uploading.</translate> <translate> This should not be a hurdle, but it seems like some archive tools occasionally fail to include all files in large archives.</translate> <translate> When this happen the vendor folder is left out, leaving the user with the rather non-explanatory error message.</translate>

<translate> Use a command line tool when recompressing the tar archive into a zip archive.

…do I get logged out constantly?

This is probably related to cookies or session data. See [[<tvar name=1>Special:MyLanguage/Help:Logging in#Log in problems</tvar>|Log in problems]] for information.

If this is happening constantly to all users, it probably means that caching is misconfigured. Setting <tvar name=1>$wgSessionCacheType = CACHE_DB;</tvar> can be used to determine if caching is the cause of the problem. If that solves the problem, you should still investigate what is wrong with your caching configuration.

…is it a good idea to keep user accounts?

</translate> 模板:Outdated <translate> At many times you just want to remove a user account out of the wiki either because it belonged to a spammer account or you just feel like it.</translate> <translate> The appropriate choice is to block the account or rename it if needed.</translate> <translate> Here is why:</translate>

<translate> Do I just remove this row from the <tvar name=1>模板:Ll</tvar> table?

[[<tvar name=1>mailarchive:wikitech-l/2007-June/031566.html</tvar>|Rob Church posted the following]] regarding this issue on the wikitech-l mailing list: </translate>

模板:Quote

<translate> Another option is to give Admins the <tvar name=1>模板:Ll</tvar> right, and indefinitely block the user with the Hide username from edits and lists option selected.

<tvar name=1>模板:Ll</tvar> is also useful.

…is the number of pages so low on Special:Statistics?

</translate> <translate> [[<tvar name=1>phab:source/mediawiki/browse/master/includes/DefaultSettings.php</tvar>|By default]], <tvar name=2>模板:Ll</tvar> is set to <tvar name=3>link</tvar>.</translate> <translate> This means the number of "Content pages" on the <tvar name=1>Special:Statistics</tvar> page only counts pages which include at least one internal link.</translate> <translate> This can be changed by setting <tvar name=1>模板:Phpi</tvar> to <tvar name=2>any</tvar>.</translate> <translate> Afterwards, run <tvar name=1>模板:Ll</tvar> and/or <tvar name=2>模板:Ll</tvar>.</translate> <translate> (On Wikimedia websites, <tvar name=1>initSiteStats.php</tvar> is run on the 1st and 15th of each month.)</translate> <translate> There might still be wrong behavior, see for example <tvar name=1>phab:T212706</tvar>.</translate>

<translate>

Anti-spam

How do I use $wgSpamRegex to block more than one string?

</translate> <translate> <tvar name=1>模板:Ll</tvar> is a powerful filter for page content.</translate> <translate> Adding multiple items to the regex, however, can be awkward.</translate> <translate> Consider this snippet:</translate>

<syntaxhighlight lang="php"> $wgSpamRegexLines[] = 'display\s*:\s*none'; $wgSpamRegexLines[] = 'overflow\s*:\s*auto'; [...] $wgSpamRegex = '/(' . implode( '|', $wgSpamRegexLines ) . ')/i'; </syntaxhighlight>

<translate> This example code allows convenient addition of additional items to the regex without fiddling about each time.</translate> <translate> It also demonstrates two popular filters, which block some of the most common spam attacks.</translate>

<translate> See also:</translate> 模板:Ll

<translate>

Are there additional ways to fight spam?

See <tvar name=1>模板:Ll</tvar> for an overview of anti-spam measures such as Captcha, content filtering and restricting edition.

Anti-vandalism

See <tvar name=1>模板:Ll</tvar> for hints and suggestions on how to deal with wiki vandalism.

Where now?

I've found a bug or have a feature request. Where do I post it?

</translate> <translate> Bugs and feature requests should be posted on <tvar name=1>模板:Ll</tvar>.</translate> <translate> See [[<tvar name=1>Special:MyLanguage/How to report a bug</tvar>|How to report a bug]].</translate>

<translate>

I'm getting a strange error. What now?

  • See if it is covered by <tvar name=1>模板:Ll</tvar></translate>

<translate>

  • Try to find out more about the problem, see <tvar name=1>模板:Ll</tvar></translate>

<translate>

  • See the [[<tvar name=1>#Still no luck. Where can I ask for help?</tvar>|section below]] for information on how to contact [[<tvar name=2>Special:MyLanguage/Developers</tvar>|developers]] and other knowledgable users.

I tried that but it didn't work

</translate>

<translate> I had a problem, I came to this page and it told me how to fix it.</translate> <translate> But it didn't work, the problem is still there!!!!</translate>

<translate> Nine times out of ten this is because you didn't [[<tvar name=1>#How do I purge a cached page?</tvar>|clear your cache]].</translate> <translate> The simple test for this is to request a page that hasn't been requested before.</translate> <translate> Select the part of the URL in the address bar that contains the page title (e.g. Main_Page).</translate> <translate> Twiddle your fingers on the keyboard for a while, hit enter.</translate> <translate> Check if the problem is on that page too.</translate>

<translate> MediaWiki uses both a server-side cache and a client-side cache, so clearing your browser cache is often not enough.</translate> <translate> See the [[<tvar name=1>#How do I purge a cached page?</tvar>|relevant entry above]] for more details.</translate>

<translate> Here are some other things to check:

  • Were you editing the right file? Try inserting some garbage into the file you edited, does it break anything?</translate>

<translate>

    • A great debugging tool in this case is to create a file called phpinfo.php, containing only <tvar name=1><syntaxhighlight lang=html inline><?php phpinfo() ?></syntaxhighlight></tvar>.</translate> <translate> Upload it into your web directory and invoke it with your browser.</translate> <translate> Check the document root and the path to php.ini.</translate>

<translate>

  • Were you editing the right part of the file?</translate> <translate> Did you create a duplicate entry in php.ini?</translate> <translate> Add new settings to the end of <tvar name=1>LocalSettings.php</tvar>, not to the beginning.</translate>

<translate>

  • If you created a .htaccess, are you sure AllowOverrides is on?</translate> <translate> Ask your hosting provider.</translate>

<translate>

I have a question not answered here. Where do I go next?

If you've exhausted the FAQ above, please try the following:

  • Check the [[<tvar name=1>Special:MyLanguage/Project:Help</tvar>|other sources of help]] on this site</translate>

<translate>

  • [[<tvar name=1>Special:Search</tvar>|Search]] the rest of this site</translate>

<translate>

  • Search the web</translate>

<translate>

  • [[<tvar name=1>Special:MyLanguage/How to become a MediaWiki hacker</tvar>|Dig into the source]]</translate>

<translate>

  • See the [[<tvar name=1>#Still no luck. Where can I ask for help?</tvar>|section below]] for information on how to contact developers and other knowledgeable users.

Still no luck. Where can I ask for help?

See the support venues listed on <tvar name=1>模板:Ll</tvar>.

See also

</translate>

[[Category:Manual{{#translation:}}]] [[Category:Configure{{#translation:}}]]