Title: Avoiding flush_rewrite_rules()
Last modified: February 18, 2021

---

# Avoiding flush_rewrite_rules()

 *  Resolved [rlamb2](https://wordpress.org/support/users/rlamb2/)
 * (@rlamb2)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/avoiding-flush_rewrite_rules/)
 * Hey, so in trying to troubleshoot some spikes in resource usage on one of my 
   sites, I noticed that your plugin is calling `flush_rewrite_rules()` on every
   page load, forcing the system to regenerate the rules that often.
 * It’s in `simple-job-board/includes/posttypes/class-simple-job-board-post-type-
   jobpost.php`, in the `simple_job_board_init` function hooked onto `init`.
 * I can’t see any reason in that particular function that would need the rewrite
   rules flushed just before adding some filters, so maybe it was left in from testing
   or something?
 * Either way, if dropping that or moving it to a more appropriate conditionally-
   run place in the code is something you can consider working into your next update,
   that’d be awesome.
 * Thanks!

Viewing 1 replies (of 1 total)

 *  Plugin Author [PressTigers](https://wordpress.org/support/users/presstigers/)
 * (@presstigers)
 * [5 years, 3 months ago](https://wordpress.org/support/topic/avoiding-flush_rewrite_rules/#post-14072167)
 * Hello [@rlamb2](https://wordpress.org/support/users/rlamb2/),
 * Thank you for writing to us.
 * We have noted down your highlighted issue and will fix it in the next release
   of SJB.
 * Regards,

Viewing 1 replies (of 1 total)

The topic ‘Avoiding flush_rewrite_rules()’ is closed to new replies.

 * ![](https://ps.w.org/simple-job-board/assets/icon-256x256.png?rev=1829069)
 * [Simple Job Board](https://wordpress.org/plugins/simple-job-board/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/simple-job-board/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/simple-job-board/)
 * [Active Topics](https://wordpress.org/support/plugin/simple-job-board/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/simple-job-board/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/simple-job-board/reviews/)

 * 1 reply
 * 2 participants
 * Last reply from: [PressTigers](https://wordpress.org/support/users/presstigers/)
 * Last activity: [5 years, 3 months ago](https://wordpress.org/support/topic/avoiding-flush_rewrite_rules/#post-14072167)
 * Status: resolved