How to export WordPress users in discourse?

There is no good way to do this at the moment, but it has been asked for a few times. The solution would be to create a WordPress import script that works in the same way as the existing Discourse import scripts.