I wanted to change the url of a page in wordpress, but when I changed the slug the url on the menu changed but when I click that menu it gives me a 404 error. I tried deleting the page (not just trash) but then the slug becomes domain.com/page-2 What can I do to fix this problem?
Try deleting the page again. Then go to your permalink settings and save them. You don't have to make any changes to the settings, saving will flush your rewrite rules and set them back up. Then try creating the page again and see if that works. If it doesn't then clear your browser cache settings.