The static and dynamic properties of vortices in a nanosized superconducting strip with one central weak link (weakly superconducting region or normal metal) are investigated in the presence of external magnetic and electric fields. The time-dependent Ginzburg–Landau equations are used to describe the electronic transport and have been solved numerically by a finite element analysis. Anisotropy is included through the spatially dependent anisotropy coefficient $$\zeta $$ ζ in different layers of the sample. Our results show that the energy barrier for vortices to enter a weak link is smaller than that for vortices to enter the superconducting layers. The magnetization shows periodic oscillations. With the introduction of the weak link, the period of oscillations decreases.