Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

I Implemented a MediaWiki site but unfortunately somebody created thousands of pages through thousand of users.

Which query could I run for deleting all pages created by these users except mine?

MediaWiki pages are in wiki_page and wiki_text inside MediaWiki database but there is no field about who created those pages.

Largest table:

  • wiki_text: 682MB
  • wiki_externallinks: 162.5 MB
  • wiki_recentchange: 95 MB
  • wiki_page: 43 MB

    Here, I find a possible answer to my problem but I'm blocked at the first step:

"Export articles created by you (presumably logged in as the WikiSysop user or similar)"

How can I export article made by me if in the table there is no field about user who created pages?

share|improve this question
    
In the link you posted there is a description on how to manually delete all pages not created by you. (webmasters.stackexchange.com/a/45486/27664) –  user555 May 5 '13 at 22:53
    
ok, so i have to run: "DELETE FROM revision WHERE rev_user != YOUR_USER_ID;" for revision page, then work on "page_latest" table and last use purgeOldText.php script for delete from wiki_text table. –  Pitone May 7 '13 at 17:42

1 Answer 1

If you know some Python (or are not afraid to learn) you should approach this with pywikibot.

You can loop through wiki.allpages() and you can add some logic to decide whether to delete a page or not. Good criteria:

  • Does the page contain specific words? E.g. related to drugs or porn.
  • Does the page have wikilinks to other pages?
  • Does the page have links from other pages?

(I can add a couple of Python lines here if there's any interest. Just let me know.)

share|improve this answer
1  
Often, the sites created by spammers are *orphans: Sites that have no other wiki sites link to them. That could be one of the criteria for deletion. I did this by hand for my club's media wiki which fortunately didn't have too many of them. –  Lagerbaer Sep 12 at 15:58

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.