diff --git src/wp-includes/class-wp-rewrite.php src/wp-includes/class-wp-rewrite.php
index 035bbc3..f9c1da8 100644
--- src/wp-includes/class-wp-rewrite.php
+++ src/wp-includes/class-wp-rewrite.php
@@ -842,6 +842,26 @@ class WP_Rewrite {
 	}
 
 	/**
+	 * Adds or updates existing rewrite tags (e.g. %postname%).
+	 *
+	 * If the tag already exists, replace the existing pattern and query for
+	 * that tag, otherwise add the new tag.
+	 *
+	 * @todo Implement this.
+	 *
+	 * @since 4.5.0
+	 * @access public
+	 *
+	 * @see WP_Rewrite::$rewritecode
+	 * @see WP_Rewrite::$rewritereplace
+	 * @see WP_Rewrite::$queryreplace
+	 *
+	 * @param string $tag Name of the rewrite tag.
+	 */
+	public function remove_rewrite_tag( $tag ) {
+	}
+
+	/**
 	 * Generates rewrite rules from a permalink structure.
 	 *
 	 * The main WP_Rewrite function for building the rewrite rule list. The
diff --git src/wp-includes/post.php src/wp-includes/post.php
index 75850bc..9e54d58 100644
--- src/wp-includes/post.php
+++ src/wp-includes/post.php
@@ -1187,6 +1187,73 @@ function register_post_type( $post_type, $args = array() ) {
 }
 
 /**
+ * Unregister a post type.
+ *
+ * @since 4.5.0
+ *
+ * @param string $post_type Post type key.
+ * @return bool True on success, false on failure.
+ */
+function unregister_post_type( $post_type ) {
+	$post_type_args = get_post_type_object( $post_type );
+
+	if ( ! $post_type_args ) {
+		return false;
+	}
+
+	// Do not allow unregistering internal post types.
+	if ( $post_type_args->_builtin ) {
+		return false;
+	}
+
+	global $wp, $wp_rewrite, $_wp_post_type_features;
+
+	// Remove query vars.
+	if ( false !== $post_type_args->query_var ) {
+		$wp->public_query_vars = array_diff( $wp->public_query_vars, array( $post_type_args->query_var ) );
+	}
+
+	// Remove any rewrite rules, permastructs, and rules.
+	if ( false !== $post_type_args->rewrite ) {
+		remove_rewrite_tag( "%$post_type%" );
+		foreach( $wp_rewrite->extra_rules_top as $regex => $query ) {
+			if ( false !== strpos( $query, "index.php?post_type=$post_type" ) ) {
+				unset( $wp_rewrite->extra_rules_top[ $regex ] );
+			}
+		}
+
+		unset( $wp_rewrite->extra_permastructs[ $post_type ] );
+	}
+
+	// @todo: Remove registered custom meta capabilities.
+
+	// Remove all post type support.
+	unset( $_wp_post_type_features[ $post_type ] );
+
+	// Remove meta boxes.
+	remove_all_actions( 'add_meta_boxes_' . $post_type );
+
+	// Remove the post type from all taxonomies.
+	foreach ( get_object_taxonomies( $post_type ) as $taxonomy ) {
+		unregister_taxonomy_for_object_type( $taxonomy, $post_type );
+	}
+
+	// Remove the future post hook actions.
+	remove_all_actions( 'future_' . $post_type );
+
+	/**
+	 * Fires after a post type is unregistered.
+	 *
+	 * @since 4.5.0
+	 *
+	 * @param string $post_type Post type.
+	 */
+	do_action( 'unregistered_post_type', $post_type );
+
+	return true;
+}
+
+/**
  * Build an object with all post type capabilities out of a post type object
  *
  * Post type capabilities use the 'capability_type' argument as a base, if the
diff --git src/wp-includes/rewrite.php src/wp-includes/rewrite.php
index 7f3b2ed..70144dc 100644
--- src/wp-includes/rewrite.php
+++ src/wp-includes/rewrite.php
@@ -173,6 +173,21 @@ function add_rewrite_tag( $tag, $regex, $query = '' ) {
 }
 
 /**
+ * Removes an existing rewrite tag (like %postname%).
+ *
+ * @since 4.5.0
+ *
+ * @global WP_Rewrite $wp_rewrite
+ * @global WP         $wp
+ *
+ * @param string $tag Name of the rewrite tag.
+ */
+function remove_rewrite_tag( $tag ) {
+	global $wp_rewrite;
+	$wp_rewrite->remove_rewrite_tag( $tag );
+}
+
+/**
  * Add permalink structure.
  *
  * @since 3.0.0
diff --git tests/phpunit/tests/post/types.php tests/phpunit/tests/post/types.php
index 02d4590..e99a217 100644
--- tests/phpunit/tests/post/types.php
+++ tests/phpunit/tests/post/types.php
@@ -159,4 +159,24 @@ class Tests_Post_Types extends WP_UnitTestCase {
 
 		_unregister_post_type( 'foo' );
 	}
+
+	/**
+	 * @ticket 14761
+	 */
+	public function test_unregister_unknown_post_type() {
+		$this->assertFalse( unregister_post_type( 'foo' ) );
+	}
+
+	/**
+	 * @ticket 14761
+	 */
+	public function test_unregister_post_type() {
+		$args = array(
+			'capability_type' => 'foo',
+		);
+
+		register_post_type( 'foo', $args );
+
+		$this->assertTrue( unregister_post_type( 'foo' ) );
+	}
 }
