Flushing from WordPress Admin

To flush WordPress rewrite rules or permalinks (usually needs to be done manually for new custom post types) from the Dashboard:

  1. In the main menu find Settings > Permalinks
  2. Scroll down if needed and click Save Changes
  3. Rewrite rules and permalinks are flushed.


Flushing rewrite rules in PHP

To flush the permalinks or rewrite rules from your theme or plugin you need to use the flush_rewrite_rules() function.

<?php flush_rewrite_rules(); ?>


Leave a Reply

Your email address will not be published. Required fields are marked *