Title: flush_rewrite_rules_hard
Published: April 25, 2014
Last modified: May 20, 2026

---

# apply_filters( ‘flush_rewrite_rules_hard’, bool $hard )

## In this article

 * [Description](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#description)
 * [Parameters](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#wp--skip-link--target)

Filters whether a “hard” rewrite rule flush should be performed when requested.

## 󠀁[Description](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#description)󠁿

A “hard” flush updates .htaccess (Apache) or web.config (IIS).

## 󠀁[Parameters](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#parameters)󠁿

 `$hard`bool

Whether to flush rewrite rules "hard". Default true.

## 󠀁[Source](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#source)󠁿

    ```php
    if ( ! $hard || ! apply_filters( 'flush_rewrite_rules_hard', true ) ) {
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/class-wp-rewrite.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/class-wp-rewrite.php#L1899)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/class-wp-rewrite.php#L1899-L1899)

## 󠀁[Related](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#related)󠁿

| Used by | Description | 
| [WP_Rewrite::flush_rules()](https://developer.wordpress.org/reference/classes/wp_rewrite/flush_rules/)`wp-includes/class-wp-rewrite.php` |

Removes rewrite rules and then recreate rewrite rules.

  |

## 󠀁[Changelog](https://developer.wordpress.org/reference/hooks/flush_rewrite_rules_hard/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.7.0](https://developer.wordpress.org/reference/since/3.7.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Fhooks%2Fflush_rewrite_rules_hard%2F)
before being able to contribute a note or feedback.