Fixing duplicate slug append (-2) on published WordPress pages with empty trash
WordPress appends -2 to a page slug when wp_unique_post_slug() finds another row in wp_posts with the same post_name, the same post_type, and the same post_parent, and a page in the trash still counts as a match because the check ignores post_status for everything except auto-draft, inherit, and revisions. Root Cause Diagnosis Trashed posts keep their … Read more