We have tons of rewrite rules saved in our wp_options table and I’d like to permanently remove any entries that we’re not using on our site (such as comment feeds, page attachments, etc.).
What’s the best way to clear these rules and prevent them from being saved to the database the next time flush_rules() is called? I’d prefer a solution that works in functions.php or as a standalone plugin, rather than editing core WP files such as wp-includes/rewrite.php.