We present a method to create and erase spatially resolved doping profiles in graphene-hexagonal boron nitride (hBN) heterostructures. The technique is based on photo-induced doping by a focused laser and does neither require masks nor photo resists. This makes our technique interesting for rapid prototyping of unconventional electronic device schemes, where the spatial resolution of the rewritable, long-term stable doping profiles is only limited by the laser spot size (~600 nm) and the accuracy of sample positioning. Our optical doping method offers a way to implement and to test different, complex doping patterns in one and the very same graphene device, which is not achievable with conventional gating techniques.