We consider wormhole solutions in five-dimensional Kaluza-Klein gravity in the presence of a massless ghost four-dimensional scalar field. The system possesses two types of topological nontriviality connected with the presence of the scalar field and of a magnetic charge. Mathematically, the presence of the charge appears in the fact that the $S^3$ part of a spacetime metric is the Hopf bundle $S^3 \rightarrow S^2$ with fibre $S^1$. We show that the fifth dimension spanned on the sphere $S^1$ is compactified in the sense that asymptotically, at large distances from the throat, the size of $S^1$ is equal to some constant, the value of which can be chosen to lie, say, in the Planck region. Then, from the four-dimensional point of view, such a wormhole contains a radial magnetic (monopole) field, and an asymptotic four-dimensional observer sees a wormhole with the compactified fifth dimension.