Purging whole namespaces of pages in MediaWiki
source link: https://hexmode.com/2020/07/purging-whole-namespaces-of-pages-in-mediawiki/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Purging whole namespaces of pages in MediaWiki
So, I was asked to purge all the pages in several categories. The smaller categories are relatively easy to do using the API sandbox.
- Visit the Special:ApiSandbox page on your wiki..
- Select the action
purge
. - Select
action=purge
from the sidebar. - Look for the
generator
option and then selectallpages
from the drop down. - Return to the top of the page and select
generator=allpages
from the sidebar. - Look for the
gapnamespace
option and select the namespace you want to purge. - Execute the request using the “Make request” button at the top of the page.
- When the request is complete, there may be the opportunity to repeat the request with the next batch of pages. You’ll see a button at the bottom of the JSON output that says “Continue”. Click it until the entire namespace has been purged.
The API sandbox will let you play around with different parameters. For example, in the last screenshot, I set gaplimit
(under generator=allpages
) to 3
but I could have set it as high as 500 if I wanted.
So for namespaces that don’t have too many pages (say, less than 1000), this is do-able. But for your average-sized wiki, a namespace is likely hold tens of thousands of pages. Something more is needed.
Posted on 2020-07-292020-08-01Author hexmodeCategories journal, mediawikiTags php
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK