Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

How to use swpm_after_logout_redirect_url hook

Simple Membership Plugin › Forums › Simple Membership Plugin › How to use swpm_after_logout_redirect_url hook

Tagged: Logout, redirect

  • This topic has 2 replies, 2 voices, and was last updated 9 years ago by mbrsolution.
Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • March 26, 2017 at 3:58 pm #10595
    jdaviswebdesign
    Participant

    I want the user to be directed to the front end of the site (the home page) after logging out, rather than having the default WordPress logout page shown. But I don’t understand how to code the swpm_after_logout_redirect_url hook in the theme’s function file. Any help please? Thank you.

    March 26, 2017 at 9:04 pm #10596
    jdaviswebdesign
    Participant

    Never mind. I found the WordPress code to do this.

    March 26, 2017 at 9:40 pm #10599
    mbrsolution
    Moderator

    I am glad you found a solution to your problem. Just in case you did not know, you could try the following function.

    You can use the following tweak to do a custom redirection after the logout event. Add the following code to your theme’s functions.php file and that should do the job. This function will allow you to keep this tweak even if you update the plugin.

    add_action('swpm_logout', 'my_custom_after_logout_redirection');
    function my_custom_after_logout_redirection()
    {
    $url = 'http://www.example.com/after-logout-page';//TODO - Specify the URL that you want to redirect to
    wp_redirect($url);
    exit();
    }
  • Author
    Posts
Viewing 3 posts - 1 through 3 (of 3 total)
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy