• Resolved dryn07

    (@dryn07)


    Hi,

    Is there a way (link/shortcode) for instant logout? The SolodWP FAQ page only mentinos a plugin but I use my own custom menu and I don’t need an additional plugin. I only need just a link that do the job.

    Thanks ??

    • This topic was modified 2 months, 1 week ago by dryn07.
Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support chandelierrr

    (@shanedelierrr)

    Hi @dryn07, glad you’re here!

    Would you please elaborate on what you’re trying to achieve with the instant logout behavior? Are you trying to put a custom menu that instantly logs out your users when they click it?

    If so, the default WP logout link looks like this: https://site.com/wp-login.php?&loggedout=true.

    But if you enabled Solid Security’s Hide Backend feature, the logout link will look like this: https://site.com/wp-login.php?itsec-hb-token=wplogin&loggedout=true (replace “wplogin” with your HBE slug)

    Please let me know if this helps.

    Thread Starter dryn07

    (@dryn07)

    Both solutions are what I was looking for, thank you. However, this is only a partial solution; my goal would be to have the user redirected to the homepage upon logout (without using an additional plugin). Is there perhaps any solution for this?

    Plugin Support chandelierrr

    (@shanedelierrr)

    Hi @dryn07, sorry for the slow turnaround here!

    Your goal to redirect users to the homepage upon logout should be achievable even with the HBE enabled by creating a custom function utilizing the wp_logout hook.

    Here’s a simplified version of the redirect behavior:

    function redirect_to_homepage_after_logout() {
    wp_redirect(home_url()); // Redirect to homepage
    exit();
    }
    add_action('wp_logout', 'redirect_to_homepage_after_logout');

    You’ll need to add your custom code to your theme’s functions.php file (preferably in the child theme) or by using a code snippet plugin.

    Hope this helps!

Viewing 3 replies - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.