How to import multiple html files into Confluence
Asked by Sarah Jacob:

Hi there,

I have a whole bunch of html files that I would like to pull into Confluence as part of my new wiki. The html files are not on the internet, they're on my hard disk. I can't see any way to pull them into Confluence. Even the html macro to cut and paste the html doesn't work - Confluence either hangs or comes up with a filepath error. I'm hoping cutting and pasting the content as text is not the only solution since it results in loss of formatting, and given the number of files I have, it's going to be a huge job to fix them up again.

Any advice appreciated!


Answers:
author: Bob Swift (personal)
body: 2 other possibilities to help:

1. [Confluence Html Plugin](https://studio.plugins.atlassian.com/wiki/display/HTML) (open source version) can pull your html files out of directory on your server.
2. [Confluence Command Line Interface](https://studio.plugins.atlassian.com/wiki/display/CSOAP) has support to script importing pages in general. There is also a **loadFiles** action for some primitive importing of html files.

comments: author: Jaime Hablutzel
body: Confluence CLI "loadFiles" command works well importing the content but I have just figured it embeds HTML content using the "html" macro, any chance to get the content in the Confluence native wiki format?


author: Mikael Mikkola
body: Now the above **links seem outdated** and UWC links lead to Bitbucket (does it have similar properties?).

It would be very nice to be able to **import a bunch of www or other html pages so that their internal links would be preserved** (even if one would have to afterwards manually edit the looks of the pages). Is there any way to do this?

We have groups that would like to import their own intranets of group pages into wiki, but I know of now other way than to copy-paste them into Confluence, remove every internal link and redo them manually, which is tedious and error-prone.

BTW, if you **copy-paste the html page into Word and then copy-paste from Word to Confluence**, you are less likely to get in some additional html code that may cause the page look different in the View mode (the links might be 10 - 60 letters away from their place!).

Moreover, if the formulation (such as bullet lists) go broke, maybe it is easier to edit them in Word before copying them into confluence. Sometimes the formulation has been more correct if I open an empty .rtf file in Word before copying into Word instead of copying into .docx mode.


author: Jaime Hablutzel
body: Go for "Confluence Command Line Interface" "loadFiles", I have just tested it and it works well, just get sure you have the "html" macro enabled in your Confluence installation (it will be disabled by default if you have migrated from OnDemand).


author: Colin Goudie
body: You should try using the UWC (Universal Wiki Converter) I think it has some support for html since pretty much just xml.

<https://studio.plugins.atlassian.com/wiki/display/UWC/UWC+Mediawiki+Notes#UWCMediawikiNotes-HtmlConversions>

comments: author: Jaime Hablutzel
body: Just tried now with some HTML (not XHTML) and it didn't worked.


Tags: content

import