Inducing electrostatic doping in 2D materials by laser exposure (photodoping effect) is an exciting route to tune optoelectronic phenomena. However, there is a lack of investigation concerning in what respect the action of photodoping in optoelectronic devices is local. Here, we employ scanning photocurrent microscopy (SPCM) techniques to investigate how a permanent photodoping modulates the photocurrent generation in MoS2 transistors locally. We claim that the photodoping fills the electronic states in MoS2 conduction band, preventing the photon-absorption and the photocurrent generation by the MoS2 sheet. Moreover, by comparing the persistent photocurrent (PPC) generation of MoS2 on top of different substrates, we elucidate that the interface between the material used for the gate and the insulator (gate-insulator interface) is essential for the photodoping generation. Our work gives a step forward to the understanding of the photodoping effect in MoS2 transistors and the implementation of such an effect in integrated devices.