Many of us have experienced permalinks suddenly 404'ing for custom post types from time to time. (i.e. on the face of it, nothing has changed in our WP setup - no new plugins installed etc.)
For example, I just had permalinks for a custom post type for a site of mine stop working all of a sudden.
It wasn't a corrupt .htaccess file. (I'm running on nginx). Simply going to Settings->Permalinks and hitting "Save Changes" fixed the issue. Presumably because this rebuilt the rewrite_rules record in wp_options
But that doesn't explain WHY the rewrite_rules record stopped working to begin with.
I do use Easy Updates Manager to automatically update plugins when new versions are available. One theory I have is that a plugin update might be incorrectly firing a rewrite rule update - or a plugin update added a new post type but didn't flush rewrite rules.
I've had this occur on some sites that are very busy eCommerce websites running WooCommerce and it seems that permalinks settings are way too brittle to be so easily broken by bad plugin actors (assuming that's what triggered this to begin with).
Is there any way to ensure rewrite rules are never broken in this manner?
Thanks.