Jump to: navigation, search

MediaWiki Howtos

Howto add Informations into this Wiki?

You must have a Login Account to create a new Site Sample URL

Edit the New Site and add your Content, later Save and Exit..

External Images are NOT allowed and blocked by the Admin Settings!

Navigationbar edit

open URL Sample:

or enter into search box:


User Password reset

1. Login via SSH to the Webspace

2. go Maintenance Path

cd /maintenance/

3. enter

php changePassword.php --user=user --password=newpass

Create New User as Admin

Disable Account Create by everyone

edit LocalSettings.php set:

$wgGroupPermissions['*']['createaccount'] = false;

Disable edit by anonymous

edit localsettings.php set:

$wgGroupPermissions['*']['edit'] = false;
$wgGroupPermissions['user']['edit'] = false;
$wgGroupPermissions['sysop']['edit'] = false;

More Details:

Change Username on MySQL Console

login into the MySQL Server, change database and enter (table prefix wiki_*):

use wikidatabasename; #change database
show tables;          #check prefix

update wikiprefix_user set user_name = 'NewName' where user_name = 'OldName';
update wikiprefix_revision set rev_user_text = 'NewName' where rev_user_text = 'OldName';
update wikiprefix_recentchanges set rc_user_text = 'NewName' where rc_user_text = 'OldName';

Now login as new Username and test the Settings, History Changes. All entries should show the new Username!

Disable Talk at Mediawiki (Spam)

Anyway, if you want to disable Talk in media wiki follow the next steps.

1. cd your_mediawiki_dir/include

2. cp SkinTemplate.php SkinTemplate.back (just in case)

3. mcedit/vi SkinTemplate.php

4. search for $content_actions['talk']

5. uncomment this lines:

/* $content_actions['talk'] = $this->tabAction(
$this->mTitle->isTalkPage() &&

or login as Admin User and enter into Searchbox:



#ca-talk {
    display: none !important;

Change Main Page

Login as Admin User and enter into Searchbox:


edit here the Common.css and paste:

.page-Wiki_Home .mw-redirectedfrom {
  display: none;

now go to Main Page and select "move to" new article post! Save and logout! Check the new Index Page! (Refresh Browsers Cache F5)

Add a new Site to Media Wiki


Enable Mobile Frontend for MediaWiki

Install the Frontende Extension to Extensions Folder and enable on LocalSettings.php

Source: Download MediaWiki Mobile Extension

wfLoadExtension( 'MobileFrontend' );
$wgMFAutodetectMobileView = true;

Protect MediaWiki after Setup

If you have Setup the MediaWiki successful by URL Sample:

don't forget to purge or rename the mw-config Folder!! Alternate set:

$sudo chmod 000 mw-config

Create Sitemap Script for Cronjob

Create a Bash Script for cron usage, like, enter:

cd /webspace/wiki/  #go to wiki path
rm -rf sitemap      #purge old sitemaps
mkdir sitemap       #create new directory for sitemaps
php maintenance/generateSitemap.php \
   --skip-redirects \
   --fspath sitemap \
   --server \
exit 0

Remark: Add the Sitemaps URL to Google/Bing Webmaster Tools! Check at the sitemaps path the Name of YOUR XML File Name!! Depends on MySQL Database Name! URL:

Enable Apache24 Sitemap Access

add to vhosts Config of the Wiki:

<Directory "/webspace/wiki/sitemap/">
Require all granted
AllowOverride All
Options -Indexes

Table of Contents TOC force

By DEFAULT the Table is shown after 4 Articles

but to force TOC create insert inside a Page:


Last Modify Date hide

go on search MediaWiki:Lastmodifiedat and purge:

<nnowiki>This page was last modified on $1, at $2</nnowiki>

Create Static Mediawiki Snapshot


How to host Mediawiki on a Raspi ? You can put the /var/www to a RAM TMPFS! and do:

nohup wget --recursive --page-requisites --html-extension \
      --convert-links --no-parent -R "*Special*" -R "*action=*" \
      -R "*printable=*"  -R "*oldid=*" -R "*title=Talk:*" \
      -R "*limit=*" "\?title=Main_Page.htm"

copy Skins:

$ cp skins/common/shared.css?207  skins/common/shared.css
$ cp skins/monobook/main.css\?207 skins/monobook/main.css
$ sed -i 's/shared\.css\%3F207/shared.css/g' *.html
$ sed -i 's/main\.css\%3F207/main.css/g' *.html


wget --mirror --convert-links --html-extension --no-parent --header "Cookie: JSESSIONID=0000k9lkMxmvmG-75Pd8CuvTIBv:-1" --page-requisites

Custom Search Engine on Mediawiki

edit LocalSettings.php set DuckDuckGo to reduce DB Load:

$wgDisableTextSearch = true;
$wgVectorUseSimpleSearch= false;
$wgSearchForwardUrl = '$1 site:';