Simple definition
WordPress rewrite rules map human-readable URLs to internal query parameters.
Technical definition
WordPress generates rewrite rules from permalink settings and registered content types. Changes to custom post types or rewrite structures may require flushing the rules, but flushing on every request is inefficient.
What’s the point?…
Make permalinks, category archives and custom post type URLs resolve correctly.
Concrete example
After registering a custom post type, refresh permalink settings once if its URLs return 404, then test the intended URL structure.
Common problems
- 404 after migration
- too common
- slug conflict
To be noted: Always adapt the diagnosis to the version of the product and to the architecture actually deployed.