Change a post’s slug
In some cases, while using pretty permalinks you might want to modify the post’s slug, either because you accidentally used the same title as another post and ended up with a ‘-2’ at the end of the URL or you are using a page and used a slug that triggers a post type archive etc.
To modify the slug of a post, page or custom post in the block editor, open the permalink metabox on the right and type in your preferred slug, then update the post.
For the classic editor edit the post and click the edit button below the URL
modify the slug and then click OK
finally make sure you update your post.
You can also change the post’s slug from the post listing page in your dashboard.
Click the quick edit link below the post’s title and then change the slug to the one you want, finally click the update button to save.