Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author M A Vinoth Kumar

    (@vinoth06)

    Hi Mas Ganank,

    So if you want to redirect it to external (other) website, then please add this action in to your function.php

    add_filter( 'logout_redirect', 'fed_custom_logout_external_url', 20, 3 );

    function fed_custom_logout_external_url(){
    return wp_safe_redirect('https://your_external_url.extension');
    }

    try this and let me know ??

    Plugin Author M A Vinoth Kumar

    (@vinoth06)

    Sorry, please update the function to

    function fed_custom_logout_external_url(){
    return esc_url('https://your_external_url.extension');
    }
    Thread Starter Gondezz

    (@masgan)

    Ok thanks very much MAS Vinoth ??

    Plugin Author M A Vinoth Kumar

    (@vinoth06)

    Welcome.. please don’t hesitate to contact for any queries

    Thread Starter Gondezz

    (@masgan)

    hello, I’ve added this code to my function.php theme and it doesn’t seem to work

    add_filter( 'logout_redirect', 'fed_custom_logout_external_url', 20, 3 );
    function fed_custom_logout_external_url(){
    return esc_url('https://www.mydomain.com');
    }

    please check if there is an error?
    or the file function I mean is wrong

    Plugin Author M A Vinoth Kumar

    (@vinoth06)

    Hi Mas,

    Sorry for my previous code, Please remove those codes and add this below one in function.php. I have checked and its working, please let me know from your end ??

    add_action('wp_logout','fed_redirect_to_external_after_logout');
    function fed_redirect_to_external_after_logout(){
        wp_redirect( 'https://google.com' );
        exit();
    }
    Thread Starter Gondezz

    (@masgan)

    thanks work well mas vinoth.

    Plugin Author M A Vinoth Kumar

    (@vinoth06)

    Glad to see it worked ?? Please never hesitate to contact us for any queries ??

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘custom redirect after logout’ is closed to new replies.