New to wordpress and not a php developer, but I'm currently having an issue with a user being redirected to a default wordpress page and being asked to confirm if the user wants to log out twice. I have added screen shots of what is going on. I tried modifying the function in functions.php that handles the logout and another function wp-login.php (picture below) but have had no luck. Has anyone else ran into this issue before or any idea how to fix it?


Below are 2 images pertaining to the behavior of my website in its current state. After I click 'logout' in my nav bar, I get taken to the page in the 3rd image below and after i click the logout button, I get taken to a duplicate page and it looks like it tags stuff on the end of the urls query parameters.

enter image description here

enter image description here

enter image description here

enter image description here

1 Answer 1


See https://codex.wordpress.org/Function_Reference/wp_logout_url , where you can define where you want to be redirected after a logout.

  • Where should this function go? in functions.php or wp-login.php? both files have stuff regarding logging out in them. Im new to WP so im trying to learn best practices
    – Scott
    Commented Apr 15, 2018 at 17:48
  • Functions that are called because of 'hooks' should go in functions.php. You probably want to create a Child Theme, so that changes to that file are not overwritten with a theme update. Lots of tutorials/info on Child Themes on the googles. Commented Apr 15, 2018 at 21:46

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.