When I delete a page, post or category that has previously been added to a custom menu, the delete routine is apparently not checking to see if the item belongs to a custom menu, and thus its not removing it from the custom menu.
This results in a 404 page error when the menu item is clicked on from the website.
So as the code is now, its up to the user to (1) have knowledge of this behavior and (2) remember to delete the item from BOTH places, to avoid embarrassing 404 “not found” and search bot crawl errors.
Is this a known bug/design flaw? It seems entirely counter-intuitive if its known and allowed to stand as is.
I should note, as pointed out below by Maugly, that once the item is removed from “Trash”, WordPress finally removes it from any custom menus. However, this is counter-intutive the the way all other WordPress menus operate. As soon as you place an item in the trash, its removed from “Pages” and “Recent Posts” widget listings, why not the same behavior for custom menus?
I’d err on the side of consistency, and even more importantly, link integrity. Users should not expect custom menus to follow a completely different set of rules with respect to deleting pages and posts than other menus.
Empty your trash 🙂
Pages are not removed from the custom menus until they’ve been deleted completely.
I’ve tested it right now.
Creating a complex nav menu can take a very long time and the pages can be bulk deleted in a sec. I believe WordPress is just trying to save you all the trouble in case of an accident.
Deleted categories are removed from nav menus instantly.