Porous polymers have immense potential in catalysis, energy conversion and storage, separation sciences and life sciences due to their high surface area and high diffusion flux. Developing porous polymers with micro and mesoscale porosity with long-range order is challenging and involves multistep templated approaches. Here we demonstrate a simple surface-oxygen induced electropolymerization route to directly obtain self-assembled porous polymers of polyparaphenylene (PPP) and PPP based copolymers in ionic liquids. By combining experimental and theoretical studies, we show that surface oxygen on Cu changes the orientation and assembly of benzene which then results in a change in electropolymerization mechanism leading to a selfassembled porous structure with porosity between 2 and 5 µm. Furthermore, with controlled experimental parameters, bicontinuous conducting polymers with porosity of >10 µm are obtained. The porous conducting polymers show absorption of light in the visible range which was also used as an efficient electrode for investigation of the photo/electrochemical oxygen evolution reaction.