Codford railway station was an intermediate station on the Salisbury branch line of the Great Western Railway built along the Wylye valley to connect Warminster and Salisbury to serve the surrounding villages, and situated along the lane from Codford St Peter to Boyton.