Title: wpmu_admin_do_redirect
Published: April 25, 2014
Last modified: May 20, 2026

---

# wpmu_admin_do_redirect( string $url = '' )

## In this article

 * [Description](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#description)
    - [See also](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#see-also)
 * [Parameters](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#parameters)
 * [Source](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#source)
 * [Related](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#related)
 * [Changelog](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#changelog)

[ Back to top](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#wp--skip-link--target)

This function has been deprecated since 3.3.0. Use [wp_redirect()](https://developer.wordpress.org/reference/functions/wp_redirect/)
instead.

Redirect a user based on $_GET or $_POST arguments.

## 󠀁[Description](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#description)󠁿

The function looks for redirect arguments in the following order:

 1. $_GET[‘ref’]
 2. $_POST[‘ref’]
 3. $_SERVER[‘HTTP_REFERER’]
 4. $_GET[‘redirect’]
 5. $_POST[‘redirect’]
 6. $url

### 󠀁[See also](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#see-also)󠁿

 * [wp_redirect()](https://developer.wordpress.org/reference/functions/wp_redirect/)

## 󠀁[Parameters](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#parameters)󠁿

 `$url`stringoptional

Redirect URL.

Default:`''`

## 󠀁[Source](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#source)󠁿

    ```php
    function wpmu_admin_do_redirect( $url = '' ) {
    	_deprecated_function( __FUNCTION__, '3.3.0', 'wp_redirect()' );

    	$ref = '';
    	if ( isset( $_GET['ref'] ) && isset( $_POST['ref'] ) && $_GET['ref'] !== $_POST['ref'] ) {
    		wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );
    	} elseif ( isset( $_POST['ref'] ) ) {
    		$ref = $_POST['ref'];
    	} elseif ( isset( $_GET['ref'] ) ) {
    		$ref = $_GET['ref'];
    	}

    	if ( $ref ) {
    		$ref = wpmu_admin_redirect_add_updated_param( $ref );
    		wp_redirect( $ref );
    		exit;
    	}
    	if ( ! empty( $_SERVER['HTTP_REFERER'] ) ) {
    		wp_redirect( $_SERVER['HTTP_REFERER'] );
    		exit;
    	}

    	$url = wpmu_admin_redirect_add_updated_param( $url );
    	if ( isset( $_GET['redirect'] ) && isset( $_POST['redirect'] ) && $_GET['redirect'] !== $_POST['redirect'] ) {
    		wp_die( __( 'A variable mismatch has been detected.' ), __( 'Sorry, you are not allowed to view this item.' ), 400 );
    	} elseif ( isset( $_GET['redirect'] ) ) {
    		if ( str_starts_with( $_GET['redirect'], 's_' ) )
    			$url .= '&action=blogs&s='. esc_html( substr( $_GET['redirect'], 2 ) );
    	} elseif ( isset( $_POST['redirect'] ) ) {
    		$url = wpmu_admin_redirect_add_updated_param( $_POST['redirect'] );
    	}
    	wp_redirect( $url );
    	exit;
    }
    ```

[View all references](https://developer.wordpress.org/reference/files/wp-includes/ms-deprecated.php/)
[View on Trac](https://core.trac.wordpress.org/browser/tags/7.0/src/wp-includes/ms-deprecated.php#L272)
[View on GitHub](https://github.com/WordPress/wordpress-develop/blob/7.0/src/wp-includes/ms-deprecated.php#L272-L305)

## 󠀁[Related](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#related)󠁿

| Uses | Description | 
| [wp_redirect()](https://developer.wordpress.org/reference/functions/wp_redirect/)`wp-includes/pluggable.php` |

Redirects to another page.

  | 
| [wpmu_admin_redirect_add_updated_param()](https://developer.wordpress.org/reference/functions/wpmu_admin_redirect_add_updated_param/)`wp-includes/ms-deprecated.php` |

Adds an ‘updated=true’ argument to a URL.

  | 
| [__()](https://developer.wordpress.org/reference/functions/__/)`wp-includes/l10n.php` |

Retrieves the translation of $text.

  | 
| [esc_html()](https://developer.wordpress.org/reference/functions/esc_html/)`wp-includes/formatting.php` |

Escaping for HTML blocks.

  | 
| [_deprecated_function()](https://developer.wordpress.org/reference/functions/_deprecated_function/)`wp-includes/functions.php` |

Marks a function as deprecated and inform when it has been used.

  | 
| [wp_die()](https://developer.wordpress.org/reference/functions/wp_die/)`wp-includes/functions.php` |

Kills WordPress execution and displays HTML page with an error message.

  |

[Show 4 more](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#)
[Show less](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#)

## 󠀁[Changelog](https://developer.wordpress.org/reference/functions/wpmu_admin_do_redirect/?output_format=md#changelog)󠁿

| Version | Description | 
| [3.3.0](https://developer.wordpress.org/reference/since/3.3.0/) | Deprecated. Use [wp_redirect()](https://developer.wordpress.org/reference/functions/wp_redirect/)  | 
| [MU (3.0.0)](https://developer.wordpress.org/reference/since/mu.3.0.0/) | Introduced. |

## User Contributed Notes

You must [log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fdeveloper.wordpress.org%2Freference%2Ffunctions%2Fwpmu_admin_do_redirect%2F)
before being able to contribute a note or feedback.