Project:Support desk

About this board

Welcome to's Support desk, where you can ask MediaWiki questions!

There are also other places where to ask :

Before you post

Post a new question

  1. To help us answer your questions, please always indicate which versions you are using (reported by your wiki's Special:Version page):
    • MediaWiki
    • PHP
    • Database
  2. Please include the URL of your wiki unless you absolutely can't. It's often a lot easier for us to identify the source of the problem if we can look for ourselves.
  3. To start a new thread, click "Start a new topic".
Previous page history was archived for backup purposes at Project:Support_desk/old on 2015-07-30.

Is there anyway to save unpublished edits to the Mediawiki database when on VisualEditor?

YousufSSyed (talkcontribs)

I know there is a drafts template, but does that support VisualEditor? If not, are there alternatives?

Reply to "Is there anyway to save unpublished edits to the Mediawiki database when on VisualEditor?"

Getting 404 Not Found with Short URLs

Leranjun (talkcontribs)

Server running apache2 on Ubuntu 20.04. Other software versions:

Product Version
MediaWiki 1.34.2
PHP 7.4.3 (apache2handler)
MariaDB 10.4.8-MariaDB-log
ICU 66.1
Lua 5.1.5

My VirtualHost conf file:

<VirtualHost *:80>
    ServerAdmin webmaster@localhost
    DocumentRoot /var/www/
    ErrorLog ${APACHE_LOG_DIR}/error.log
    CustomLog ${APACHE_LOG_DIR}/access.log combined

    # HTTPS autogenerated by certbot
    RewriteEngine on
    RewriteCond %{SERVER_NAME} [OR]
    RewriteCond %{SERVER_NAME}
    RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]

    RewriteEngine On
    RewriteRule ^/?wiki(/.*)?$ %{DOCUMENT_ROOT}/w/index.php [L]
    RewriteRule ^/?$ %{DOCUMENT_ROOT}/w/index.php [L]

    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
    RewriteRule ^/?w/images/thumb/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2 [L,QSA,B]

    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
    RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
    RewriteRule ^/?w/images/thumb/archive/[0-9a-f]/[0-9a-f][0-9a-f]/([^/]+)/([0-9]+)px-.*$ %{DOCUMENT_ROOT}/w/thumb.php?f=$1&width=$2&archived=1 [L,QSA,B]

And in LocalSettings.php:

## The URL base path to the directory containing the wiki;
## defaults for all runtime URL paths are based off of this.
## For more information on customizing the URLs
## (like /w/index.php/Page_title to /wiki/Page_title) please see:
$wgScriptPath = "/w";
$wgScriptExtension = ".php";
$wgArticlePath = "/wiki/$1";

However, when I visit any page on my site under "wiki" (e.g., it gives a 404 error.

The usual index.php method is working fine.

Can anybody kindly offer some help?

Ciencia Al Poder (talkcontribs)
Leranjun (talkcontribs)

Oopsies, fixed that yesterday, forgot to post here.

Thanks anyway!

Reply to "Getting 404 Not Found with Short URLs"
The-Psychid (talkcontribs)

I'm still constructing my wiki, and I'm currently having trouble with changing the logo image. This screenshot should show you what I mean:

My wiki currently under construction, with some difficulty in the logo itself

I've literally tried everything, including $wgLogo and the like, but still to no success. Am I doing something wrong? If it helps, I'm using the "Refreshed" skin for my wiki.

Malyacko (talkcontribs)

Which exact steps have you performed? What is shown in the network tab of the developer tools of your web browser when it comes to 404 errors?

The-Psychid (talkcontribs)

Well, first, I went to the manual for changing the wiki's logo, and then to the FAQ, but to no avail. At one point, I thought I had it at one point, but the logo's "broken image" was in front of it, which was kinda distracting. I even set the logo to the recommended measurements, in pixels (135 x 135), for good measure.

I even did the "Ctrl+Shift+C" method to determine what this variable would be called, as shown in the provided screenshot.

Is it a.main.header-button or #site-info-main a.main?

As for the question of what's "shown in the network tab," I don't know if it helps, but I'm using Avast! Secure Browser, which I assume is kinda like Google Chrome.

Malyacko (talkcontribs)

Please check the network (!) tab of your developer tools for 404 errors to find out what that broken image is and where it comes from.

The-Psychid (talkcontribs)
Bawolff (talkcontribs)

what do you have $wgLogo set to? What url is your logo actually located at? Does the logo work in vector skin? (To determine whether your logo is set wrong or if the skin is broken)

In the second image provided, it is using \\ as the path seperator. It probably doesnt make a difference but it should be /

The-Psychid (talkcontribs)

Right now, I have the $wgLogo set to the following:

$wgLogo = $wgScriptPath . '/images/e/e0/CHRONIXII_Header.png';

And note, that it's all on the same line; I say this because I know it said something about putting a part of the code underneath something, but I couldn't quite understand it.

Jonathan3 (talkcontribs)
Reply to "Can't Change Logo Image"

Deleted data still in wiki_text and shrink Mariadb database

Beardedfool (talkcontribs)


I've been trying to work out why our wiki_text table is 600+Mb with only 461 pages but am past my level of expertise, help please!

I did have an over-zealous script running through editpage.php that made a ton of edits - I've deleted that page but I can still see data from it through a mysql > select *

Pages with the most revisions shows the largest having 235 revisions. That page had thousands (I think) but maybe it's hidden as it was through editpage.php, or a template?

Is there some way to get rid of this old data and shrink the database?

Problem: Database larger than expected, or is it

Assuming that I'm right and the mediawiki text table only has text in it, it seems large for what we have in it

<root:/var/lib/mysql/wiki# ls -alS | head -2
total 775M
-rw-rw---- 1 mysql mysql 664M Sep 21 21:10 wiki_text.ibd
Database changed
MariaDB [wiki]> SELECT
    ->      table_schema as `Database`,
    ->      table_name AS `Table`,
    ->      round(((data_length + index_length) / 1024 / 1024), 2) `Size in MB`
    -> FROM information_schema.TABLES
    -> ORDER BY (data_length + index_length) DESC;
| Database           | Table                                              | Size in MB |
| wiki               | wiki_text                                          |     659.55 |
| wiki               | wiki_revision                                      |       7.78 |

This seems... large

MariaDB [wiki]> select COUNT(*) from wiki_text;
| COUNT(*) |
|    15530 |
1 row in set (0.06 sec)

Page Statistics

Page statistics
Content pages	461
(All pages in the wiki, including talk pages, redirects, etc.)	697
Uploaded files	512
Edit statistics
Page edits since XXXX was set up	15,577
Average edits per page	22.35


is a fair bit smaller but still large

mysqldump wiki > wiki.sql
-rw-r--r-- 1 root root 417M Sep 21 22:04 wiki.sql
dumpBackup.php --full

is only about 41Mb

Old data

It does seem to have to data in the table that has been deleted

select COUNT(*) from wiki_text where old_text like '%Areca%';.
| COUNT(*) |
|       13 |
1 row in set (3.06 sec)

decribe wiki_text

MariaDB [wiki]> describe wiki_text;
| Field     | Type             | Null | Key | Default | Extra          |
| old_id    | int(10) unsigned | NO   | PRI | NULL    | auto_increment |
| old_text  | mediumblob       | NO   |     | NULL    |                |
| old_flags | tinyblob         | NO   |     | NULL    |                |
3 rows in set (0.00 sec)

Maintenance tools tried


root:/var/lib/mediawiki/maintenance# php deleteOldRevisions.php
Delete old revisions

Searching for active revisions...done.
Searching for inactive revisions...done.
3552 old revisions found.


root:/var/lib/mediawiki/maintenance# php purgeOldText.php
Searching for active text records via contents table...done.
Searching for inactive text records...done.
0 inactive items found.


This should be another table anyway but just in case someone comes across it as a solution

root:/var/lib/mediawiki/maintenance# php deleteArchivedRevisions.php
Found 0 revisions to delete.

Shrinking Maridb

Not convinced this is actually doing anything. It went up at one point after deleting old revisions

MariaDB [wiki]> OPTIMIZE TABLE wiki_text;
| Table          | Op       | Msg_type | Msg_text                                                          |
| wiki.wiki_text | optimize | note     | Table does not support optimize, doing recreate + analyze instead |
| wiki.wiki_text | optimize | status   | OK                                                                |
2 rows in set (18.67 sec)
Reply to "Deleted data still in wiki_text and shrink Mariadb database"
Mikebisson (talkcontribs)

I have been running for ten years. Everything works much as I want it to, despite still using  Version 1.17.2; PHP 5.6.40 (apache2handler) MySQL 5.6.44-log. I may move to a new host next year and it would probably be advisable to upgrade to the latest software versions before doing so. However, I am concerned about the continuing compatibility of extensions, chiefly multi-upload, which is crucial to my work because I add up to 5,000 images a year. I have discovered that multi-upload is no longer supported and the latest version released in 2019 appears to be more complicated than the one I have been running for years. I have installed it with 1.34.2 on another wiki and it doesn't work. I am wondering whether SimpleBatchUpload is the answer to my needs if I upgrade Mediawiki. I need a routine which allows me to quickly select up to 20 (or more?) images from my folders and import them into my wiki

MarkAHershberger (talkcontribs)

SimpleBatchUpload would take care of your needs. And it isn't too hard to install.

Ciencia Al Poder (talkcontribs)
Reply to "Batch uploads"

Preventing to create empty pages

Summary by Fokebox

Need to find out one more detail

Fokebox (talkcontribs)

I have a problem at my wiki, most of the users are school pupils and they often create just empty pages adding just a couple words. Are there any tool that can prevent to create empty pages or pages with just couple of words?

Wargo (talkcontribs)
Ciencia Al Poder (talkcontribs)

Extension:AbuseFilter will work for this. You can create a rule like this:

 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)
Fokebox (talkcontribs)

Guys, can you help me please. How to download Extension:AbuseFilter for older version of my wiki. I have 1.29.1

Bawolff (talkcontribs)

you should use a newer version. Mediawiki 1.29 hasnt been recieving security updates for over a year.

That said, you can get old versions from github . I'm not sure if github downloads include vendor dependencies (prob not) so you also have to run composer install --no-dev in the AbuseFilter directory after you have unpacked it

Fokebox (talkcontribs)

It seems to be that I have successfully installed the extension. So we shall I put this code?:

 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)

In localsettings.php file?

Ciencia Al Poder (talkcontribs)
Fokebox (talkcontribs)

Yes, now I try to use it ) Thanks

So, when I try to save the filter in this code:

 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)

I have a system mistake, that there is an error in syntax

Bawolff (talkcontribs)

Syntax seems fine to me, are you sure you tried to add that code exactly?

Fokebox (talkcontribs)
Bawolff (talkcontribs)


 &!("#redirec" in lcase(added_lines))
 & (new_size < 20)

instead (older versions of abusefilter might require that instead).

Fokebox (talkcontribs)

Thanks! Now all seems to be fine, all works!

Fokebox (talkcontribs)

Can you also help me how to create a filter that will not allow to non-registered users to insert external links in articles?

Matěj Suchánek (talkcontribs)
action == 'edit'
& user_age == 0
& article_namespace == 0
& added_lines rlike 'https?://'
Fokebox (talkcontribs)

Hi! Can you please help me. I want to make an exception for uploaded files. So it it necessary to provide description and the filter blocks uploading if there isn't such description. So I want users allow to upload files without descriptions

Matěj Suchánek (talkcontribs)

Adding article_namespace !== 6 & or action !== 'upload' & should suffice.

Fokebox (talkcontribs)


The whole code looks now so:

 &!("#redirec" in lcase(added_lines))
 & (new_size < 30)
 & action !== 'upload'
Fokebox (talkcontribs)

Thx! Works perfect!

How to get Special:Upload File under Tools?

3 (talkcontribs)

For some reason when I created my Wiki site, Upload File was not an option under Tools. How do I make it an option?

AhmadF.Cheema (talkcontribs)
Foreclosurepedia (talkcontribs)

MW 1.34.2: Same problem here. I cannot even add it manually to the Sidebar.

I have the EnableUploads set to true. Even attempting to add Special:Upload with or without brackets does not work.

Reply to "How to get Special:Upload File under Tools?"
Yug (talkcontribs)

Hello folks,
A WM project ( closely connected to Commons via API bumped into API ratelimits. The documentation of this is really limited and dispersed. I added a specific section into API:Upload#Ratelimits, but I encourage you do create the page API:Ratelimit to properly document this dimension :

  • list of actions which can be limited
  • where to configure ratelimits
  • how to see the ratelimits

I collected some information and API link in as well, which can be useful for a first draft. I'am not a mediawiki developper, I don't feel legitimate enough to create and write such documentation page on the official mediawiki website. I therefor submit to confirm editors and programmers this issue to consider.

Bawolff (talkcontribs)

Note, technically is not a Wikimedia project (but its clearly highly related).

There is some documentation at manual:$wgRateLimits but i agree there should be more/better.

The rate limits on commons are pretty high for uploads for autoconfirmed accounts. It depends a bit on if lingualibre is using the users own account to upload (e.g. via oauth or client side) or of there is a bot account. For non autoconfirmed users there are also ip based limits i think -so if its using oauth and everything comes from lingualibre servers that might be an issue (which is not the intention of ip based limits)

Reply to "API:Ratelimit"

How to add additional tab on the page

Fokebox (talkcontribs)

Hello world,

We have usually two tabs on the top of the page: Article page and Discussion page. How can I add third tab when I need it?

Ammarpad (talkcontribs)
Fokebox (talkcontribs)

Thanks. It is quite difficult solution for my wiki as I need this „third tab“ only at some pages, not at every page.

Reply to "How to add additional tab on the page"

Antispam settings using AbuseFilter extension

Summary by Fokebox


Fokebox (talkcontribs)

Hello all,

I use Extension:AbuseFilter to prevent creating empty pages by using this rule:

 &!("#redirec" in lcase(added_lines))
 & (new_size < 30)

what I see it requires also to have some description while uploading any files. Can you please help to make some exception for uploading files so that it is not necessary to provide such description?

Fokebox (talkcontribs)


 &!("#redirec" in lcase(added_lines))
 & (new_size < 30)
 & action !== 'upload'