Flushing Rewrite Rules on All Sites in a Multisite Network
TL;DR: Loop through all sites and delete_option( 'rewrite_rules' ). Don’t call flush_rewrite_rules(). Full example. Every once in awhile I’ll run into a situation where something will break permalinks on all the sites in a WordPress Multisite network, like a plugin network-activation gone wrong. On a single site, it’s easy enough to fix by manually visiting Settings > […]