• I have been looking for a way to logout of a wordpress site from a link on another web app that lives in a subdir outside of wordpress.

    If the link points to:
    https://my.domain.net/wp-login.php?action=logout&redirect_to=http%3A%2F%2Fmy.domain.net/

    I get the WordPress Failure Notice page:
    “You are attempting to log out of My Domain”
    “Do you really want to log out?”

    Clicking on the link does delete the cookies but the Failure Notice page remains and I need it to redirect.

    I managed to get it to redirect correctly by adding to my functions.php

    function my_logout_url() {
    	return 'https://my.domain.net/wp-login.php?action=logout&redirect_to=https://my.domain.net/&loggedout=true';
    }
    add_filter('logout_url', 'my_logout_url');

    But this doesn’t logout the user.

    Anyone have any ideas?
    Thanks.

  • The topic ‘How can I logout of a wordpress site using a link from another web app?’ is closed to new replies.