4

I have a mediawiki site that is no longer edited. I'd like to save the content as static HTML and disable the wiki - in a word, unwikify the site.

This would include removing all the edit/discussion links, so a simple mirror using wget isn't what I'm looking for.

Is there an easy way to do this?

Sideshow Bob
  • 4,566
  • 5
  • 42
  • 79
  • Are the edit/discussion links somehow easily identifiable in the document? Like through a specific class or ID – Pekka Feb 18 '12 at 10:22
  • Here are [Cam Webb’s instructions](http://camwebb.info/blog/2012-12-20/) for making a static version of a MediaWiki site. Here are [my own](http://reluk.ca/project/votorola/b/wiki-copy/), in case they help anyone. Both give links to the static result ([mine here](http://reluk.ca/project/votorola/b/wiki-copy/wiki-copy.task)). See in my [wget call](http://reluk.ca/project/votorola/b/wiki-copy/wget) the line `r+=':action=(?!edit|history|info|raw)'` for enabling/disabling of action links, and `r+='!.+Special(?:%3A|:)'` for exclusion of namespaced pages, such as `Special:` or `User_talk:`. – Michael Allan Jun 01 '18 at 20:06
  • see also: [Obtaining static HTML files from Wikipedia XML dump](https://stackoverflow.com/questions/10713330/obtaining-static-html-files-from-wikipedia-xml-dump) – milahu Jun 30 '23 at 23:51

2 Answers2

1

You can alter the template to remove all those edit/discussion links. After that, you can wget mirror the site if you like, or just keep it as is. Wiki can cache those pages, so it's not a tremendous amount of effort for your webserver to keep feeding those pages through mediawiki.

But anyhow I would keep the wiki as well, so you can always go back, change the template and re-export it.

I actually have a site with such an altered template. That way, I use the a wiki on a different (protected) domain, that uses the same database, for editing, while another just displays the pages. You must remember to remove all editing rights as well, though, because otherwise people could still edit the pages by typing in a specific url.

GolezTrol
  • 114,394
  • 18
  • 182
  • 210
0

Use http://www.mediawiki.org/wiki/Extension:DumpHTML

Joshua C. Lerner
  • 1,910
  • 17
  • 12
  • 1
    Maybe not. From the web page: Beware, cowboy! DumpHTML required a lot of work and is permanently broken since August 2008. It stopped working shortly after it was split from core in 2008; complicated in 2009; worsened by ResourceLoader in 2010 and then in 2011 and later. – user1062589 Dec 23 '16 at 19:03