Context. Anti-cyclonic vortices are considered to be a favourable places for trapping dust and forming planetary embryos. On the other hand, they are massive blobs that can interact gravitationally with the planets in the disc. Aims. We aim to study how a vortex interacts gravitationally with a planet that migrates towards the vortex or with a planet that is created inside the vortex. Methods. We performed hydrodynamical simulations of a viscous locally isothermal disc using GFARGO and FARGO-ADSG. We set a stationary Gaussian pressure bump in the disc so that a large vortex is formed and maintained as a result of Rossby wave instability (RWI). After the vortex is established, we implanted a low-mass planet ([5, 1, 0.5] × 10 −6 M ) in the outer disc or inside the vortex and allowed it to migrate. We also examined the effect of vortex strength on the planet migration by doubling the height of the bump and checked the validity of the final result in the presence of self-gravity. Results. We noticed that regardless of the planet's initial position, the planet is finally locked to the RWI-created vortex in a 1:1 resonance or its migration is stopped at a larger orbital distance, in case of a stronger vortex. For the model with the weaker vortex (our standard model), we studied the effect of different parameters such as background viscosity, background surface density, mass of the planet, and different planet positions. In these models, while the trapping time and locking angle of the planet vary for different parameters, the main result, which is the planet-vortex locking, remains valid. We discovered that even a planet with a mass less than 5 × 10 −7 M comes out from the vortex and is locked to it at the same orbital distance. For a stronger vortex, both in non-selfgravitating and self-gravitating models, the planet migration is stopped far away from the radial position of the vortex. This effect can make the vortices a suitable place for continual planet formation under the condition that they save their shape during the planetary growth.