Heterogeneous two-dimensional layered membranes reconstructed from natural or synthetic van der Waals materials enable novel ion transport mechanisms by coupling with the chemistry and optoelectronic properties of the layered constituents. Here, we report a light-driven and pH-dependent bidirectional ion transport phenomenon through porphyrin metal-organic framework (PMOF) and transition metal dichalcogenides based multi-layer van-der-Waals heterostructures with sub-nanometer ionic channels. In acidic solutions, we find generation of a net ionic flow through the PMOF-WS 2 multi-layers upon visible light illumination. Surprisingly, in alkaline solutions, the light-driven ionic flow can be switched to the opposite direction. The driving mechanism is generally understood as a photovoltaic effect due to type II band alignment of PMOF and WS 2 .Copper ion substitution in porphyrin centers is incomplete; and at high pH, deprotonation of the non-cooperoccupied porphyrin units gives rise to a band alignment inversion that explains the unexpected ionic photocurrent reversion. We demonstrate a light-powered and pH-stimulated ionic synapse as an application of this bidirectional driving mechanism. Using pH as a chemical modulation factor for post-synthetic band