The themes of the stories related to travel to the next world show the point of the ideas and beliefs of writers and nations as the foundation of such works. By comparing the thoughts and ideas raised in such works, we can lay open the thoughts and beliefs of different nations to a large extent, and we can lay open the actions and reactions of different nations. There are many of such stories which include travel to the next world. Although they have differences, they all have one thing in common, which is the moral load of such travel writings, a point which turn them into didactic works. The works are generally of two types. The first kind is pedagogical literature to train moral, cultural and religious virtues and the second type which try to (train scientific, literary, and grammatical concepts. On the other hand, around the world, many travel writings have been composed. Despite their differences, they have devoted some parts to education, training and moral issues. So we can take the hereafter itineraries as didactic literature. This paper compares and contrasts the pedagogical functions of Erdavirafnameh and Alghofran) as two spiritual travels to the next world. Erdavirafmamehis famous for the political and social issues of its time and is categorized under the teaching first type mentioned above. But in Alghofran, in addition to training values and moral, cultural and religious virtues, special attention is also given to the syntactic and poetic aspects of the language and Arabic grammar. For this reason, the language used in Alghofran is complex and includes some literary complications. The very two contexts are different regarding religious approaches such as reward and punishment, heaven or hell. For many reasons, Marri emphasizes encouraging as well as announcing the aspects of education and talks more about the heaven rather than the hell while Erdadirfnameh is mainly based on punishment and threatening the reader from punishment. The very two contexts are different regarding religious approaches such as reward and punishment and heaven or hell.