I have the following function:

  $user_id = esc_html($_GET['id']);   if(empty($user_id)){
    wp_redirect('https://homepage.com/');
    exit;

Now when I type in homepage.com/innerpage/?id= , since $user_id is empty, it should redirect to homepage.com which it doesn’t do. Similarly if I simply type in homepage.com/innerpage/.

I also notice that the black menu bar (for wordpress admin) at the top dissapears and I see white space instead of it.

Read more here: WordPress not redirecting if $_GET[‘id’] is not set


Solution:

If you know the solution of this issue, please leave us a reply in Comment section, to update the question.


Wordpress related questions and answers: