W3cubDocs

/WordPress

flush_rewrite_rules( bool $hard = true )

Remove rewrite rules and then recreate rewrite rules.

Description

Parameters

$hard

(bool) (Optional) Whether to update .htaccess (hard flush) or just update rewrite_rules transient (soft flush). Default is true (hard).

Default value: true

Source

File: wp-includes/rewrite.php

function flush_rewrite_rules( $hard = true ) {
	global $wp_rewrite;
	$wp_rewrite->flush_rules( $hard );
}

Changelog

Version Description
3.0.0 Introduced.

© 2003–2019 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/flush_rewrite_rules