We develop optical and near-infrared colour-selection criteria based on the model colours of binaries consisting of a white dwarf and a main-sequence star. Using our colour-selection algorithm, we present a catalogue of 523 white dwarf–main sequence (WDMS) binaries from the spectroscopic Sloan Digital Sky Survey Data Release 7 (SDSS DR7), most of them previously identified. Among them, we identify 86 objects as new WDMS binaries. 95 WDMS candidates are also found from the photometric SDSS DR7, cross-matched with the United Kingdom Infrared Telescope (UKIRT) Infrared Sky Survey Data Release 5 (UKIDSS DR5). Based on a χ2 minimization technique, we derive independent stellar parameters such as the effective temperatures, surface gravities, masses and distances of the white dwarfs and secondary stars and the metallicities of the secondaries. Meanwhile, we determine the cooling age via interpolation through evolutionary models for the effective temperature and surface gravity of each DA white dwarf. Distributions of these stellar parameters have been used to study both the general properties and the completeness of WDMS binaries. A comparison between the distances measured to the white dwarfs and the secondary stars shows a clear trend towards higher distances for the white dwarf component. It is found that the mean cooling age of the WDMS sample is yr and our sample contains at least 11 per cent old systems, which were formed about 1.0 × 109 yr ago. The new and updated WDMS binaries will improve the completeness of the catalogue of WDMS binaries.