Convert WordPress comments to Artrans (Artalk data format)
Go to file
cyp0633 888c0d1a70
update readme
2023-06-18 10:32:00 +08:00
cmd/WP2Artran change name 2023-06-17 22:46:40 +08:00
internal change name 2023-06-17 22:46:40 +08:00
.gitignore add conf parser 2023-06-16 20:48:36 +08:00
LICENSE add license 2023-06-17 23:12:01 +08:00 update readme 2023-06-18 10:32:00 +08:00 update readme 2023-06-18 10:32:00 +08:00
go.mod change name 2023-06-17 22:46:40 +08:00
go.sum add conf parser 2023-06-16 20:48:36 +08:00

WP2Artran - WordPress to Artalk comment format

简体中文 zh-CN

Compared to the legacy export method, REST API is obviously a more modern way to retrieve WordPress comments. On the other hand, Artrans is a comment format used by Artalk and can be imported into some other comment systems, e.g. Twikoo. This makes Artrans a good intermediate comment format.

We assume that both your old and new site is online, and you've set up redirections of the new site. For example, there's an old post on a WordPress instance at, and the corresponding new post is at "Set up redirections" means that when someone visits, the browser will be redirected to You don't have to set Artalk or anything else up on the new site.

You need a configuration file to use this tool. We continue to take the example above. In this case, your configuration is as below:

  hostname: ""
  permalink-prefix: "/archives/"

  hostname: ""
  permalink-prefix: "/post/"

output-path: "./comments.json.artrans"


You MUST specify output Artrans file path by output-path field.

The content of auth field involves in WordPress application password. To generate the password, please refer to "Generating Manually" section in the official documentation. Or you could use any credential pair that's supported by REST API authentication method.

After setting all those up, run the following command:

$ ./WP2Artran config.yaml

The app will automatically fetch comments via WordPress REST API, resolve redirections, and convert it to Artrans. If redirection resolution fails, the app will print a warning and continue to convert the comment. In that case, the PageKey field of the Artran is the old post ID (/123/ in the example).