If I create a page with the slug "exams" and then need to change the page's slug from "exams" to "tests", any other pages in WordPress that link to the original permalink now have broken links as WordPress doesn't do any internal link checking when updating a page.
One way around this would be if WordPress inserted internal links with the default format of the page ID instead of the slug, e.g.
/?p=123, as that never changes. Plus, when you navigate to the ID, the permalink setting in .htaccess are applied and change it to the slug automatically.
I saw a pretty slick solution in this post that does just this when using the visual editor, but I wasn't sure if there were any gotchas or drawbacks with this method.
Is there a more comprehensive way that doesn't rely on the visual editor to handle this? Since the above solution doesn't handle scenarios like pasting links or working in the text editor, I was thinking that a solution that hooked into the create/update action and searched the database to catch all the links might be more comprehensive, but I don't know what hook to start with.
While changing the permalink doesn't happen frequently, it's annoying that when it does any internal pages that point to the original link are now dead.