diff --git src/wp-includes/taxonomy.php src/wp-includes/taxonomy.php
index 9865f42..0d21bfe 100644
--- src/wp-includes/taxonomy.php
+++ src/wp-includes/taxonomy.php
@@ -476,6 +476,60 @@ function register_taxonomy( $taxonomy, $object_type, $args = array() ) {
 }
 
 /**
+ * Unregister a taxonomy.
+ *
+ * @since 4.5.0
+ *
+ * @global WP    $wp            Current WordPress environment instance.
+ * @global array $wp_taxonomies List of taxonomies.
+ *
+ * @param string $taxonomy Taxonomy name.
+ * @return bool|WP_Error True on success, WP_Error on failure.
+ */
+function unregister_taxonomy( $taxonomy ) {
+	if ( ! taxonomy_exists( $taxonomy ) ) {
+		return new WP_Error( 'invalid_taxonomy', __( 'Invalid Taxonomy' ) );
+	}
+
+	$taxonomy_args = get_taxonomy( $taxonomy );
+
+	// Do not allow unregistering internal taxonomies.
+	if ( $taxonomy_args->_builtin ) {
+		return new WP_Error( 'invalid_taxonomy', __( 'Unregistering a built-in taxonomy is not allowed' ) );
+	}
+
+	global $wp_taxonomies, $wp;
+
+	// Remove query var.
+	if ( false !== $taxonomy_args->query_var ) {
+		$wp->remove_query_var( $taxonomy_args->query_var );
+	}
+
+	// Remove rewrite tags and permastructs.
+	if ( false !== $taxonomy_args->rewrite ) {
+		remove_rewrite_tag( "%$taxonomy%" );
+		remove_permastruct( $taxonomy );
+	}
+
+	// Unregister callback handling for metabox.
+	remove_filter( 'wp_ajax_add-' . $taxonomy, '_wp_ajax_add_hierarchical_term' );
+
+	// Remove the taxonomy.
+	unset( $wp_taxonomies[ $taxonomy ] );
+
+	/**
+	 * Fires after a taxonomy is unregistered.
+	 *
+	 * @since 4.5.0
+	 *
+	 * @param string $taxonomy Taxonomy name.
+	 */
+	do_action( 'unregistered_taxonomy', $taxonomy );
+
+	return true;
+}
+
+/**
  * Builds an object with all taxonomy labels out of a taxonomy object
  *
  * Accepted keys of the label array in the taxonomy object:
diff --git tests/phpunit/includes/utils.php tests/phpunit/includes/utils.php
index 0a6dfc1..00d1b32 100644
--- tests/phpunit/includes/utils.php
+++ tests/phpunit/includes/utils.php
@@ -334,7 +334,7 @@ function _unregister_post_type( $cpt_name ) {
 }
 
 function _unregister_taxonomy( $taxonomy_name ) {
-	unset( $GLOBALS['wp_taxonomies'][$taxonomy_name] );
+	unregister_taxonomy( $taxonomy_name );
 }
 
 /**
diff --git tests/phpunit/tests/taxonomy.php tests/phpunit/tests/taxonomy.php
index 0cf6516..0b01939 100644
--- tests/phpunit/tests/taxonomy.php
+++ tests/phpunit/tests/taxonomy.php
@@ -530,4 +530,99 @@ class Tests_Taxonomy extends WP_UnitTestCase {
 		$tax = get_taxonomy( 'wptests_tax' );
 		$this->assertFalse( $tax->query_var );
 	}
+
+	/**
+	 * @ticket 35227
+	 */
+	public function test_unregister_taxonomy() {
+		register_taxonomy( 'foo', 'post' );
+		$this->assertWPError( unregister_taxonomy( 'foo' ) );
+	}
+
+	/**
+	 * @ticket 35227
+	 */
+	public function test_unregister_taxonomy_unknown_taxonomy() {
+		$this->assertWPError( unregister_taxonomy( 'foo' ) );
+	}
+
+	/**
+	 * @ticket 35227
+	 */
+	public function test_unregister_taxonomy_twice() {
+		register_taxonomy( 'foo', 'post' );
+		$this->assertTrue( unregister_taxonomy( 'foo' ) );
+		$this->assertWPError( unregister_taxonomy( 'foo' ) );
+	}
+
+	/**
+	 * @ticket 35227
+	 */
+	public function test_unregister_taxonomy_disallow_builtin_taxonomy() {
+		$this->assertWPError( unregister_taxonomy( 'post_tag' ) );
+		$this->assertWPError( unregister_taxonomy( 'category' ) );
+	}
+
+	/**
+	 * @ticket 35227
+	 */
+	public function test_unregister_taxonomy_removes_query_vars() {
+		global $wp;
+
+		register_taxonomy( 'foo', 'post', array( 'query_var' => 'bar' ) );
+
+		$this->assertInternalType( 'int', array_search( 'bar', $wp->public_query_vars ) );
+		$this->assertTrue( unregister_taxonomy( 'foo' ) );
+		$this->assertFalse( array_search( 'bar', $wp->public_query_vars ) );
+	}
+
+	/**
+	 * @ticket 35227
+	 */
+	public function test_unregister_taxonomy_removes_rewrite_rules() {
+		$this->set_permalink_structure( '/%postname%' );
+
+		global $wp_rewrite;
+
+		register_taxonomy( 'foo', 'post', array( 'query_var' => 'bar' ) );
+
+		$count_before = count( $wp_rewrite->rewritereplace );
+
+		$this->assertInternalType( 'int', array_search( '%foo%', $wp_rewrite->rewritecode ) );
+		$this->assertInternalType( 'int', array_search( 'bar=', $wp_rewrite->queryreplace ) );
+		$this->assertTrue( unregister_taxonomy( 'foo' ) );
+		$this->assertFalse( array_search( '%foo%', $wp_rewrite->rewritecode ) );
+		$this->assertFalse( array_search( 'bar=', $wp_rewrite->queryreplace ) );
+		$this->assertSame( --$count_before, count( $wp_rewrite->rewritereplace ) ); // Array was reduced by one value.
+	}
+
+	/**
+	 * @ticket 35227
+	 */
+	public function test_unregister_taxonomy_removes_taxonomy_from_global() {
+		global $wp_taxonomies;
+
+		register_taxonomy( 'foo', 'post' );
+
+		$this->assertInternalType( 'object', $wp_taxonomies['foo'] );
+		$this->assertInternalType( 'object', get_taxonomy( 'foo' ) );
+
+		$this->assertTrue( unregister_taxonomy( 'foo' ) );
+
+		$this->assertFalse( isset( $wp_taxonomies['foo'] ) );
+		$this->assertFalse( get_taxonomy( 'foo' ) );
+	}
+
+	/**
+	 * @ticket 35227
+	 */
+	public function test_unregister_taxonomy_removes_meta_box_callback() {
+		global $wp_filter;
+
+		register_taxonomy( 'foo', 'post' );
+
+		$this->assertSame( 1, count( $wp_filter['wp_ajax_add-foo'] ) );
+		$this->assertTrue( unregister_taxonomy( 'foo' ) );
+		$this->assertSame( array(), $wp_filter['wp_ajax_add-foo'] );
+	}
 }
