Support » Plugin: Peter's Login Redirect » Logout redirect stopped working

  • Resolved Max Beta


    WordPress 5.3

    Logouts are set to show a specific page. It worked before but now a logout stops at the WordPress login form.

Viewing 15 replies - 1 through 15 (of 20 total)
  • My logout to a specific page also stopped working for me.
    Fix please.

    I cannot get logout redirect working. The rul_before_user_logout filter does not seem to be fired.

    Looks like logout is being handled by wplogin_redirect.php instead

    WP 5.3

    Similarly – after 2 years working fine, Logout now tries to stay with page displayed when actioning Logout, leading to 404 message which is unacceptable to users. Seems to be after recent WP upgrades with latest plugin version.

    I have the same problem – after logging out the user is returned to the default WP login page, ie the plugin’s logout redirect isn’t working.

    Same here. If anyone has a solution, I would be most grateful. Seems to be after recent WP upgrades with latest plugin version: WP 5.2.5 and Peter’s 2.9.4 logout redirect works, WP 5.3.2 and Peter’s 2.9.4 logout redirect isn’t working, Although the author, two days ago, declared 100% compatibility with wp 5.3.2 …

    @tartadotta… I have switched to using Peter’s Login Redirect. It works well for me and handles both login and logout as required. Very flexible.

    I have a particular login requirement in that users may be directed to a page that requires them to login. I then want them to stay on the page they were trying to get to and not sent somewhere else. I added the following filter that achieves this.

      * Catch login and redirect so that the user stays on the same page rather than getting sent to home page */
    function ovni_login_redirect_rule($custom_redirect_to, $redirect_to, $requested_redirect_to, $user){
    	global $wp;
    	if (!$requested_redirect_to){
    		return(wp_get_referer());  // back to page with login form
    	return($custom_redirect_to);  // else follow redirect

    @antipole, I use peter’s plugin for years without problems, but as I indicated, since the last update of wp works perfectly the login redirect but the logout redirect does not comply with the assigned rule and reloads the same page indicated in the redirect login rule (that if it is set visible only after authenticizing shows an error message…) I will now try to disable one plugin at a time to see if the culprit is WP 5.3.2 or there are accomplices…

    I have seen the code as indicated, which is better to explain how you use it, even if I do not think it solves my problem of logout redirect …

    I tried to disable all plugins except Peter’s Plugin, operate the login redirect but not the redirect logout … “guilty” should be wp 5.3.2 …, @antipole have any ideas? Or do you know how to verify that? Thanks

    • This reply was modified 1 year, 2 months ago by tartadotta.

    Since there a filter is available when redirecting after login, there is very likely one for redirecting after log out, although I have not looked to check.. Suggest you hook on to that and redirect as you wish.

    In the code I gave above, I omitted the actual add-filter action. It is:

    add_filter('rul_before_user', 'ovni_login_redirect_rule', 10, 4);

    Thread Starter Max Beta


    @antipole Are the snippet for this plugin or Peter’s Login Redirect?

    @max-beta – confused by your question. They are for this plugin: Peter’s Login Redirect. I have previously posted this on another topic on this support forum here and should have linked to it rather than repeat.

    Thread Starter Max Beta


    @antipole I think my question was very clear with no room for confusing. Thanks for clearing my confusion though.

    • This reply was modified 1 year, 2 months ago by Max Beta.

    Hello everyone, today I had the final evidence that the redirect logout does not work at the transition from wp 5.2.5 to 5.3, I cloned a site that was configured:

    WP 5.2.5
    Peters’ login 2.9.4
    Profile builder 3.0.5 (my login form)
    …other plugins
    Php 7.2.7
    My sql 5.5.5

    Everything is perfectly functional.

    I cloned it on another space, the only difference was php’s version (7.3.24), everything is fine.
    Then with the plugin “WP Downgrade | Specific Core Version” I update the cloned site to wp 5.3 (only modification) and the redirect logout stopped operating, reported to wp 5.2.5, which started to operate again…

    At this point, I do not know what to do, when the author declared the plugin compatible with 100% with wp 5.3.2 …and I did not understand how to change and use the code of @antipole and where to insert it… Since the login redirect works (and it is the most important thing for me) it would suffice to me that on logout, all users (regardless of their role) would return to home page …

    @max – beta have you solved the problem?


    Thread Starter Max Beta


    @antipole @tartadotta… I must apologise for my previous messages. I receive an email leading me here then I see that you wrote “I have switched to using Peter’s Login Redirect”. I then thought that was a recommendation for another similar plugin … now I realize that the plugin we are discussing here is Peters… sorry.

    • This reply was modified 1 year, 2 months ago by Max Beta.
    • This reply was modified 1 year, 2 months ago by Max Beta.
    • This reply was modified 1 year, 2 months ago by Max Beta.
    Thread Starter Max Beta


    @tartadotta… I don’t have the time right now to investigate. Trying to follow the discussion and waiting for an answer from the developer… hmm ..

Viewing 15 replies - 1 through 15 (of 20 total)
  • The topic ‘Logout redirect stopped working’ is closed to new replies.