Customizations for HTML Export Using URL Parameters
Last modified by Eleni Cojocariu on 2026/02/19 17:57
Reference
You can export a Page in HTML format, but you can also trigger a HTML export by changing the URL of Pages. For example, replacing "/view/" with "/export/", and adding the parameter ?format=html will export the current Page from the current wiki in HTML format:
http://server/xwiki/bin/export/Page?format=html, where "Space" is considered to be the top-level Page of a hierarchy.
The format of a Page pattern to export is wikiid:pageFullNamePattern, where:
- wikiid: the name of the wiki from which to get the wiki Pages. It doesn't need to be specifed if you're targeting Pages from the current wiki.
- pageFullNamePattern: the full name pattern of the Page is based on an SQL "LIKE" comparator. Remember that the character % must be converted to %25 in a URL.
The URL parameters to customize the export:
| Parameter | Description | Example |
|---|---|---|
| pages | Specifies the Pages to include in the export, using a pattern that matches Page names. You can use multiple Pages parameters, each representing a Page pattern. | http://server/xwiki/bin/export/Page?format=html&pages=PageName |
| name | Specifies the name of the exported ZIP file. If not specified, a default name will be used. | This http://server/xwiki/bin/export/Page?format=html&name=packagename exports the current Page from the current wiki in "packagename.zip" |
| excludes | Specifies the Pages to exclude from the export, using a pattern that matches Page names. You can use multiple Excludes parameters. All special characters must be encoded in the URL. | http://server/xwiki/bin/export/Page?format=html&pages=News.%25&excludes=OtherPage |
Examples of how to use the parameters:
- Exports the current page from the current wiki:
http://server/xwiki/bin/export/Space/Page?format=html - Exports the current page from the current wiki in packagename.zip:
http://server/xwiki/bin/export/Space/Page?format=html&name=packagename - Exports all the pages from the Space space as well as the Space2.Page page from the current wiki:
http://server/xwiki/bin/export/Space/Page?format=html&pages=Space.%25&pages=Space2.Page - Exports all the pages from the Space space located in the wiki2 subwiki:
http://server/xwiki/bin/export/Space/Page?format=html&pages=wiki2:Space.%25 - Exports all pages in the Main space except pages under Main.Space1 space, and all pages under Other space:
http://server/xwiki/bin/export/Space/Page?format=html&pages=Main.%25&excludes=Main.Space1.%25&pages=Other.%25 - Exports all pages in the subwiki:Main space except a page named subwiki:Main.Excluded&Other and subwiki:Main.WebHome:
http://server/xwiki/bin/export/Space/Page?format=html&pages=subwiki:Main.%25&excludes=subwiki%3AMain.Excluded%26Other&subwiki%3AMain.WebHome - Exports all pages in the Main space and all in the Other space except Other.Excluded (see the empty excludes for respecting the order):
http://server/xwiki/bin/export/Space/Page?format=html&pages=Main.%25&excludes=&pages=Other.%25&excludes=Other.Excluded - Exports all pages from the current wiki:
http://server/xwiki/bin/export/Space/Page?format=html&pages=%25.%25 - Exports all pages from the "somewiki" wiki:
http://server/xwiki/bin/export/Space/Page?format=html&pages=somewiki:%25.%25