I've used CPT UI to create a few custom post types on a real estate website, one of which is called "team". It's worked fine up until recently... Older team entries show up as expected, both in the list/archive view and the single view. However, we've recently added a new team member entry and discovered that only the single view causes a "page not found" error. After more testing it turns out that any new entry to the "team" post type causes an error in the single view only -- they pop up in the archive view just fine.
Just to be clear: the older team entries all display as they should in both archive and single view. Any new team entries show in the archive view, but cause a 404 in the single view.
I've tried re-saving the permalink settings, using plain permalink settings, flush_rewrite_rules(), and I've checked for any slug conflicts. I'm totally stumped.
UPDATE: After some debugging as recommended (thank you!) I think I've found the problem... The page request is using an old meta key in the query vars that isn't present in new entries. Somehow, WordPress is internally using the meta key 'agent_last_name'
when it should be using 'agent_alpha_name'
. I'm guessing I need a way to force this to refresh?