Is it possible to purge all pages in mediawiki? I've tried emptying the obejctcache table to no avail. I don't particularly want to hit each page with ?action=purge
appended. Version 1.23.3

- 4,445
- 6
- 44
- 78
-
Stack Overflow is a site for programming and development questions. This question appears to be off-topic because it is not about programming or development. See [What topics can I ask about here](http://stackoverflow.com/help/on-topic) in the Help Center. Perhaps [Super User](http://superuser.com/), [Web Apps Stack Exchange](http://webapps.stackexchange.com/) or [Webmaster Stack Exchange](http://webmasters.stackexchange.com/) would be a better place to ask. – jww Nov 20 '15 at 13:28
-
1@jww the simple fact the question is over a year old, not closed and has upvotes and answers with votes would suggest to you that a) it's a suitable question which is useful to the community or b) is in dire need of being closed. And besides, this question is about development of a mediawiki site which involved programming. – user3791372 Nov 21 '15 at 08:15
3 Answers
You can either
Use the maintainance script PurgeList.php like this:
php purgeList.php --purge --all
, for MW > 1.21, andphp purgeList.php --all-namespaces
for MW > 1.34. Really old MW versions do not have the--all
option, so you will need a list of pages.Use the API: API:Purge, and feed it with a list of all pages (that you can get from API:Allpages)
Invalidate all caches by setting
$wgCacheEpoch
to the current time in LocalSettings.php, e.g.$wgCacheEpoch = 20140901104232;
.Set
$wgInvalidateCacheOnLocalSettingsChange
(since MW 1.17) to achieve pretty much the same thing. Only do this if your wiki has low to moderate traffic.Not sure if this is a good idea, but if you have access to the wiki's database you should also be able to achieve the same effect by truncating the table
objectcache
.

- 8,106
- 7
- 48
- 80
-
`php purgeList.php --purge --all` does nothing in my case. I can't find a way to permanently delete all the pages. (( – zhekaus Oct 02 '19 at 10:27
-
@zhekaus This question is not about deleting pages, but about purging their caches – leo Oct 02 '19 at 17:51
-
1
Invalidate all caches for all sites with this simple command:
touch /etc/mediawiki/LocalSettings.php
because in the touch LocalSettings.php
file there is this part:
# When you make changes to this configuration file, this will make
# sure that cached pages are cleared.
$wgCacheEpoch = max( $wgCacheEpoch, gmdate( 'YmdHis', @filemtime( __FILE__ ) ) );
__FILE__
is the LocalSettings.php
file itself, so if the filetime is now, all cache older than the file will be purged.

- 19,527
- 31
- 134
- 226
-
1
-
3Note that this is not part of `LocalSettings.php` since MW 1.17. Instead, there is a setting called `$wgInvalidateCacheOnLocalSettingsChange` that will achieve pretty much the same. This method is great for smaller wikis, but [not recommended](https://www.mediawiki.org/wiki/Manual:$wgInvalidateCacheOnLocalSettingsChange) for high traffic wikis. – leo Oct 27 '15 at 08:55