We report a novel approach to the fabrication of self-aligned nanoscale trench structures in a thin polymer layer covering on conductive materials. By passing AC current through a polymer-coated nanowire in the presence of an appropriate solvent, a self-aligned nanotrench is formed in the polymer overlayer as a result of accelerated dissolution while the rest of the device remains covered. Similar results have been achieved for polymer-coated graphene ribbons. Such polymer-protected devices in which only the active component is exposed should find important applications as electrical sensors in aqueous solutions, particularly in cases where parasitic ionic currents often obscure sensing signals.