The combination of ZIFs with semiconductor materials is expected to get multi-functional hybrid materials with synergistic effects of the individual components. ZnO/ZIF-8 composites with blocklike structure were synthesized via a hydrothermal method. The dark and illuminated current density of the ZnO/ZIF-8 photoelectrodes is greatly decreased compared with pure ZnO. Opposite changes of photocurrent response are observed with addition of hole scavengers with different sizes, which verifies the molecular size selectivity of photoelectrochemical (PEC) response of ZnO/ZIF-8 composite. This novel composite may be potentially developed into a new-type of PEC sensors with molecular size selectivity.