Improving the interfacial adhesion is the key to improve and to guarantee stable performance of organic–inorganic solar cells. In this paper, we demonstrate a proof-of-concept approach by using a biomimetic initiator to initiate on-site electrochemical polymerization of pyrrole inside TiO2 nanotubes so as to improve the adhesion during formation of coaxial p–n nanohybrids. The new bifunctional anchor of N-(3,4-dihydroxyphenethyl)-pyrrole-2-carboxamide (Dop-Py) is inspired by mussel adhesive proteins and can strongly anchor to TiO2, and so provides a grafted monomer for initiation of electropolymerization. Much quicker polymerization rate and larger density of polypyrrole (PPy) are achieved than that without the biomimetic initiator. In addition, interface adhesion between PPy and TiO2 is dramatically enhanced, and so the improved charge transfer efficiency as indicated by impedance characterization, suggesting that this is a promising strategy for fabricating ordered organic/inorganic p–n heterojunctions.