- In the dashboard menu go to Settings > Permalinks.
- Select any other option and click Save Changes.
- That’s what you need to flush the permalinks, you can re-select the last option too.
Flushing permalinks via PHP
You can flush the permalinks via php by using the function flush_rewrite_rules().
<?php flush_rewrite_rules(); ?>