Skip to main content

iI have a simple solution. Please, please read:

  1. If you are using wp_redirect($url) in theme files, and it is not working add ob_clean() ob_start() in your function file on top.

    If you are using wp_redirect($url) in theme files, and it is not working add ob_clean() ob_start() in your function file on top.

  2. If using in plugin add ob_clean() ob_start() in the main plugin file on top.

    If using in plugin add ob_clean() ob_start() in the main plugin file on top.

And make sure you have added exit() function after wp_redirect($url)exit() function after wp_redirect($url) Like this $url = 'http://example.com'; wp_redirect($url); exit();

$url = 'http://example.com';
wp_redirect($url);
exit();

i have a simple solution. Please read

  1. If you are using wp_redirect($url) in theme files, and it is not working add ob_clean() ob_start() in your function file on top.
  2. If using in plugin add ob_clean() ob_start() in the main plugin file on top.

And make sure you have added exit() function after wp_redirect($url) Like this $url = 'http://example.com'; wp_redirect($url); exit();

I have a simple solution, please read:

  1. If you are using wp_redirect($url) in theme files, and it is not working add ob_clean() ob_start() in your function file on top.

  2. If using in plugin add ob_clean() ob_start() in the main plugin file on top.

And make sure you have added exit() function after wp_redirect($url) Like this:

$url = 'http://example.com';
wp_redirect($url);
exit();
Source Link
yogesh
  • 141
  • 1
  • 3

i have a simple solution. Please read

  1. If you are using wp_redirect($url) in theme files, and it is not working add ob_clean() ob_start() in your function file on top.
  2. If using in plugin add ob_clean() ob_start() in the main plugin file on top.

And make sure you have added exit() function after wp_redirect($url) Like this $url = 'http://example.com'; wp_redirect($url); exit();