Wikispaces to WordPress
Wikispaces is a wiki-hosting platform that is shutting down in late 2018.
For those wanting to migrate to WordPress, this is a set of command-line tools to convert a Wikispaces export over into a WordPress site.
Note: This only converts HTML files over to WordPress pages. This does not import any Wikispaces discussions, events or anything else.
How to use?
- Clone this repo or download and extract the contents somewhere.
In your command-line prompt, navigate to the location where you extracted the contents and run
composer installto install our dependencies.
Open your Wikispaces HTML export ZIP file and extract all HTML files into the
sourcedirectory. For example,
source/Test.htmlwould be a valid example. Your HTML files should not reside in subdirectories.
config.phpand open the file to view what you can configure for the converter script. Please spend a few minutes going over these options.
* This is the base URL filepath where your new exported files reside.
* If your Wikispaces HTML ZIP export contains a 'files' subdirectory and you
* set this variable to example.com, then you should upload all items from the
* 'files' subdirectory to http://example.com/files/.
* Once this is set, the script will change all Wikispaces file links to the
* new URL.
* If you want to import your Wikispaces content into an existing WordPress
* network site, set this variable.
* This is used to tell WP-CLI which site to import the contents into.
* It's best to create a new sub-site instead of using an existing one.
* The WordPress post type you want to use for the Wikispaces content.
* Defaults to 'page'.
Once you are satisfied, run our converter script in the command-line with
This will create a bunch of text files in the
outputdirectory to the root of your WordPress install.
output/cmd.txtfile. This should have a list of WP-CLI commands that you’ll use to import the Wikispaces content into your WordPress site. Copy the entire contents of that file.
- In your command-line prompt, ensure you are in the root of your WordPress install. Next, paste the contents into your command-line prompt. This should start the process of importing each post into your WordPress site.
Lastly, you’ll want to make sure that internal links to your Wikispaces content will use WordPress permalinks.To do this, copy the
wiki-link.phpfile from this repository to the root of your WordPress install and run the following WP-CLI command:
wp eval-file wiki-link.phpNote: If you imported the Wikispaces content into a specific site on WP multisite install, you’ll want to append the
--url=https://subsite.example.comparameter to let WP-CLI know which site to use. (Change
subsite.example.comto whatever site you are using.)
Congrats! You’ve now converted your Wikispaces content into your new WordPress site!
- DiDom – A PHP script for parsing HTML files