Let \(G\) be a connected graph. The Wiener index of \(G\) is defined as
\(W(G) = \sum_{u,v \in V(G)} d_G(u,v),\) where \(d_G(u,v)\) is the distance between \(u\) and \(v\) in \(G\) and the summation goes over all the unordered pairs of vertices. In this paper, we investigate the Wiener index of unicyclic graphs with given girth and characterize the extremal graphs with the second maximal and second minimal Wiener index.