private function empty_taxonomies() {
		global $wpdb;

		// Empty taxonomies and terms
		$terms      = $wpdb->get_results( "SELECT term_id, taxonomy FROM $wpdb->term_taxonomy" );
		$taxonomies = [];
		foreach ( (array) $terms as $term ) {
			$taxonomies[] = $term->taxonomy;
			wp_cache_delete( $term->term_id, $term->taxonomy );
		}

		$taxonomies = array_unique( $taxonomies );
		$cleaned    = [];
		foreach ( $taxonomies as $taxonomy ) {
			if ( isset( $cleaned[ $taxonomy ] ) ) {
				continue;
			}
			$cleaned[ $taxonomy ] = true;

			wp_cache_delete( 'all_ids', $taxonomy );
			wp_cache_delete( 'get', $taxonomy );
			delete_option( "{$taxonomy}_children" );
		}
		$wpdb->query( "TRUNCATE $wpdb->terms" );
		$wpdb->query( "TRUNCATE $wpdb->term_taxonomy" );
		$wpdb->query( "TRUNCATE $wpdb->term_relationships" );
		if ( ! empty( $wpdb->termmeta ) ) {
			$wpdb->query( "TRUNCATE $wpdb->termmeta" );
		}
	}
private function empty_taxonomies() {
		global $wpdb;

		// Empty taxonomies and terms
		$terms      = $wpdb->get_results( "SELECT term_id, taxonomy FROM $wpdb->term_taxonomy" );
		$taxonomies = [];
		foreach ( (array) $terms as $term ) {
			$taxonomies[] = $term->taxonomy;
			wp_cache_delete( $term->term_id, $term->taxonomy );
		}

		$taxonomies = array_unique( $taxonomies );
		$cleaned    = [];
		foreach ( $taxonomies as $taxonomy ) {
			if ( isset( $cleaned[ $taxonomy ] ) ) {
				continue;
			}
			$cleaned[ $taxonomy ] = true;

			wp_cache_delete( 'all_ids', $taxonomy );
			wp_cache_delete( 'get', $taxonomy );
			delete_option( "{$taxonomy}_children" );
		}
		$wpdb->query( "TRUNCATE $wpdb->terms" );
		$wpdb->query( "TRUNCATE $wpdb->term_taxonomy" );
		$wpdb->query( "TRUNCATE $wpdb->term_relationships" );
		if ( ! empty( $wpdb->termmeta ) ) {
			$wpdb->query( "TRUNCATE $wpdb->termmeta" );
		}
	}
private function empty_taxonomies ( ) { global $ wpdb ; // Empty taxonomies and terms $ terms = $ wpdb -> get_results ( "SELECT term_id, taxonomy FROM $wpdb->term_taxonomy" ) ; $ taxonomies = [ ] ; foreach ( ( array ) $ terms as $ term ) { $ taxonomies [ ] = $ term -> taxonomy ; wp_cache_delete ( $ term -> term_id , $ term -> taxonomy ) ; } $ taxonomies = array_unique ( $ taxonomies ) ; $ cleaned = [ ] ; foreach ( $ taxonomies as $ taxonomy ) { if ( isset ( $ cleaned [ $ taxonomy ] ) ) { continue ; } $ cleaned [ $ taxonomy ] = true ; wp_cache_delete ( 'all_ids' , $ taxonomy ) ; wp_cache_delete ( 'get' , $ taxonomy ) ; delete_option ( "{$taxonomy}_children" ) ; } $ wpdb -> query ( "TRUNCATE $wpdb->terms" ) ; $ wpdb -> query ( "TRUNCATE $wpdb->term_taxonomy" ) ; $ wpdb -> query ( "TRUNCATE $wpdb->term_relationships" ) ; if ( ! empty ( $ wpdb -> termmeta ) ) { $ wpdb -> query ( "TRUNCATE $wpdb->termmeta" ) ; } }
Delete terms, taxonomies, and tax relationships.
Delete terms taxonomies and tax relationships .