During real-world (RW) exploration, rodent hippocampal activity shows robust spatial selectivity, which is hypothesized to be governed largely by distal visual cues, although other sensory-motor cues also contribute. Indeed, hippocampal spatial selectivity is weak in primate and human studies that use only visual cues. To determine the contribution of distal visual cues only, we measured hippocampal activity from body-fixed rodents exploring a two-dimensional virtual reality (VR). Compared to that in RW, spatial selectivity was markedly reduced during random foraging and goal-directed tasks in VR. Instead we found small but significant selectivity to distance traveled. Despite impaired spatial selectivity in VR, most spikes occurred within ∼2-s-long hippocampal motifs in both RW and VR that had similar structure, including phase precession within motif fields. Selectivity to space and distance traveled were greatly enhanced in VR tasks with stereotypical trajectories. Thus, distal visual cues alone are insufficient to generate a robust hippocampal rate code for space but are sufficient for a temporal code.