You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Navigation: Remove links to a permanently deleted post or term from Navigation Menus #85573
When a post or term is permanently deleted, the Navigation Link or Submenu block pointing at it stays in every wp_navigation post that links to it. The front end hides it and the editor flags it as invalid, but nothing removes it.
Classic menus handle this: _wp_delete_post_menu_item() and _wp_delete_tax_menu_item() delete the matching menu items on delete_post and delete_term. Trash and unpublish are read-time only in Core, and block menus already cover those at render time.
What is your proposed solution?
Match Core on permanent deletion, for bound links only:
On delete_post and delete_term, remove every Navigation Link block whose URL is bound to the deleted post or term (a core/post-data or core/term-data binding on url, which the link UI adds when a link is picked from the site's content) from every Navigation Menu, at any depth.
A link with a typed-in URL and no binding is left alone, even when it carries the ID.
A matching Navigation Submenu keeps its label and inner blocks and loses only its link attributes, so the menu structure stays in place.
Activity