WordPress at a glance
function is not described

WP_Taxonomy::remove_rewrite_rules() public WP 4.7.0

Removes any rewrite rules, permastructs, and rules for the taxonomy.

{} It's a method of the class: WP_Taxonomy{}

No Hooks.

Return

null. Nothing.

Usage

$WP_Taxonomy = new WP_Taxonomy();
$WP_Taxonomy->remove_rewrite_rules();

Notes

  • Global. WP. $wp Current WordPress environment instance.

Changelog

Since 4.7.0 Introduced.

Code of WP_Taxonomy::remove_rewrite_rules() WP 5.7.2

<?php
public function remove_rewrite_rules() {
	/* @var WP $wp */
	global $wp;

	// Remove query var.
	if ( false !== $this->query_var ) {
		$wp->remove_query_var( $this->query_var );
	}

	// Remove rewrite tags and permastructs.
	if ( false !== $this->rewrite ) {
		remove_rewrite_tag( "%$this->name%" );
		remove_permastruct( $this->name );
	}
}