Topological quantum materials exhibit fascinating properties1-3, with important applications for dissipationless electronics and fault-tolerant quantum computers4,5. Manipulating the topological invariants in these materials would allow the development of topological switching applications analogous to switching of transistors6. Lattice strain provides the most natural means of tuning these topological invariants because it directly modifies the electron-ion interactions and potentially alters the underlying crystalline symmetry on which the topological properties depend7-9. However, conventional means of applying strain through heteroepitaxial lattice mismatch10 and dislocations11 are not extendable to controllable time-varying protocols, which are required in transistors. Integration into a functional device requires the ability to go beyond the robust, topologically protected properties of materials and to manipulate the topology at high speeds. Here we use crystallographic measurements by relativistic electron diffraction to demonstrate that terahertz light pulses can be used to induce terahertz-frequency interlayer shear strain with large strain amplitude in the Weyl semimetal WTe2, leading to a topologically distinct metastable phase. Separate nonlinear optical measurements indicate that this transition is associated with a symmetry change to a centrosymmetric, topologically trivial phase. We further show that such shear strain provides an ultrafast, energy-efficient way of inducing robust, well separated Weyl points or of annihilating all Weyl points of opposite chirality. This work demonstrates possibilities for ultrafast manipulation of the topological properties of solids and for the development of a topological switch operating at terahertz frequencies.