diff --git a/src/wp-includes/rewrite.php b/src/wp-includes/rewrite.php
index 67dade3..5aa8777 100644
--- a/src/wp-includes/rewrite.php
+++ b/src/wp-includes/rewrite.php
@@ -22,6 +22,21 @@ function add_rewrite_rule($regex, $redirect, $after = 'bottom') {
 }
 
 /**
+ * Remove a rewrite rule.
+ *
+ * @see WP_Rewrite::add_rule() for long description.
+ * @since 4.0.0
+ *
+ * @param string $regex Regular Expression to match request against.
+ * @param string $redirect Page to redirect to.
+ * @param string $after Optional, default is 'bottom'. Where to add rule, can also be 'top'.
+ */
+function remove_rewrite_rule($regex, $redirect, $after = 'bottom') {
+	global $wp_rewrite;
+	$wp_rewrite->remove_rule($regex, $redirect, $after);
+}
+
+/**
  * Add a new rewrite tag (like %postname%).
  *
  * The $query parameter is optional. If it is omitted you must ensure that
@@ -1938,6 +1953,30 @@ class WP_Rewrite {
 	}
 
 	/**
+	 * Remove a rewrite rule.
+	 *
+	 * @since 4.0.0
+	 * @access public
+	 *
+	 * @param string $regex Regular expression to match against request.
+	 * @param string $redirect URL regex redirects to when regex matches request.
+	 * @param string $after Optional, default is bottom. Location to place rule.
+	 */
+	public function remove_rule($regex, $redirect, $after = 'bottom' ) {
+		$strpos_to_end_of_filename_of_regex = (strpos($redirect, '?') == false ? strlen($redirect) : strpos($redirect, '?'));
+		$front = substr($redirect, 0, $strpos_to_end_of_filename_of_regex);
+		if ( $front != $this->index ) { //it doesn't redirect to WP's index.php
+			$this->remove_external_rule( $regex, $redirect );
+		} else {
+			if ( 'bottom' == $after ) {
+				unset( $this->extra_rules[$regex] );
+			} else {
+				unset( $this->extra_rules_top[$regex] );
+			}
+		}
+	}
+
+	/**
 	 * Add a rule that doesn't redirect to index.php.
 	 *
 	 * Can redirect to any place.
@@ -1953,6 +1992,19 @@ class WP_Rewrite {
 	}
 
 	/**
+	 * Remove a rule that doesn't redirect to index.php.
+	 *
+	 * @since 4.0.0
+	 * @access public
+	 *
+	 * @param string $regex Regular expression to match against request.
+	 * @param string $redirect URL regex redirects to when regex matches request.
+	 */
+	public function remove_external_rule( $regex, $redirect ) {
+		unset( $this->non_wp_rules[$regex] );
+	}
+
+	/**
 	 * Add an endpoint, like /trackback/.
 	 *
 	 * @since 2.1.0
