Select Page

How to put wikimedia in read only mode

I am encountering strong spammings tentatives in my Wiki as well, that’s why I decide to lock write changes to my WIki. This is how You can also do it.

Open LocalSettings.php and set a new key $wgReadOnlyFile like this 


The value must be the name of of a file, then put the reason for the lock inside the file using the wikipedia notation

”’I’ve block my Wiki because of spammers! It will reopen as soon as I find a solution, if It annoy You can still contact me at”’

The contents of the file will be displayed to anyone trying to edit the wiki.

Note that readonlyfile is not guaranteed to be absolutely safe; if you need to guarantee that MediaWiki will never write to the data, you need to do this on the database itself (e.g. revoke UPDATE,INSERT,DELETE from the wiki user, or put MySQL into read-only mode).

About The Author

Cédric Walter

I worked with various Insurances companies across Switzerland on online applications handling billion premium volumes. I love to continuously spark my creativity in many different and challenging open-source projects fueled by my great passion for innovation and blockchain technology.In my technical role as a senior software engineer and Blockchain consultant, I help to define and implement innovative solutions in the scope of both blockchain and traditional products, solutions, and services. I can support the full spectrum of software development activities, starting from analyzing ideas and business cases and up to the production deployment of the solutions.I'm the Founder and CEO of Disruptr GmbH.