The stability and electronic properties of the hexagonal, trigonal and rectangular cross-sectional GaP nanowires in wurtzite (WZ) phase are investigated using full potential linear augmented plane waves method. The rectangular cross-sectional nanowires are found more stable than the hexagonal and trigonal ones. The indirect bandgap structure of the nanowires is transformed into the direct bandgap one at a critical size connected to the geometry of the cross-section. The energy bandgap of the nanowires in the same cross-sectional group is enlarged by the quantum size effect. The effective carrier masses in the nanowires, calculated to be larger than those in bulk GaP, are found to slightly increase with the decrease in the size of the nanowires in the same cross-sectional groups. The mechanical strain effect on the electronic band structure is investigated for the rectangular GaP nanowires under the uniaxial and lateral strains. It is found that the indirect bandgap structures of the rectangular nanowires are transformed into the direct bandgap ones by the uniaxial high compression strains. It is also found that this transformation can be triggered by small uniaxial tensile and high lateral tensile strains in addition to the effect of size increase. The energy bandgap of the rectangular nanowires is determined to be narrowed by the uniaxial/lateral strains. It is obtained that the small rectangular nanowire is in the indirect bandgap structure for all the lateral strains and the larger one can be transformed into the direct bandgap structure more easily by the x-directional lateral tensile strains compared to the y-directional ones. The effective electron and hole masses are found to be reduced by the uniaxial highest tensile and compression strains of this work. It is determined that the lateral strains are not effective in making the electrons of the nanowires more mobile, but the y-directional lateral high tensile strains make the holes more mobile by reducing the effective hole mass in the small rectangular nanowire.