Title: redirection after logout using wpmem_logout shortcode failed
Last modified: October 17, 2018

---

# redirection after logout using wpmem_logout shortcode failed

 *  Resolved [ktakahisa](https://wordpress.org/support/users/ktakahisa/)
 * (@ktakahisa)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/redirection-after-logout-using-wpmem_logout-shortcode-failed/)
 * the redirection using wpmem_logout shortcode doesn’t work.
 * `[wpmem_logout url="http://example.com/some-page/"]`
 * the shortcode above is on the “Other Shortcodes” page:
    [https://rocketgeek.com/plugins/wp-members/docs/shortcodes/other-shortcodes/](https://rocketgeek.com/plugins/wp-members/docs/shortcodes/other-shortcodes/)
 * I’m using wp-members with “Polylang” multilingual plugin.
    for example, for english
   language users, I want to redirect them to english top page like: http:example.
   com/en/
 * but the shortcode redirect them to non-language-spacified top page like:
    http:
   example.com/
 * any suggestions?

Viewing 2 replies - 1 through 2 (of 2 total)

 *  Plugin Author [Chad Butler](https://wordpress.org/support/users/cbutlerjr/)
 * (@cbutlerjr)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/redirection-after-logout-using-wpmem_logout-shortcode-failed/#post-10788827)
 * Unfortunately, that appears to be a mistake in the documentation (and the code).
   Even though that attribute is there, the way that the logout function processes,
   it will never work. I’ll look into working out a possibility in the future, but
   for now that method is a no go.
 * To redirect on logout, you do need to use the [wpmem_logout_redirect](https://rocketgeek.com/plugins/wp-members/docs/filter-hooks/wpmem_logout_redirect/)
   filter. Apply a conditional test in your filter function to check for the language(
   use WP’s get_locale() or Polylang’s pll_current_language() to check the locale)
   and redirect based on the result.
 *  Thread Starter [ktakahisa](https://wordpress.org/support/users/ktakahisa/)
 * (@ktakahisa)
 * [7 years, 7 months ago](https://wordpress.org/support/topic/redirection-after-logout-using-wpmem_logout-shortcode-failed/#post-10788988)
 * thank you for the advice.
    I was able to switch redirects using the filter. I
   hope the shortcode will work properly in the near future.
 * for a reference, the code I used:
 *     ```
       function my_logout_redirect(){
         $current_locale = get_locale();
         if( $current_locale == 'en-US' ):
           $redirect_url = 'http://www.example.com/en-US/';
         else:
           $redirect_url = 'http://www.example.com/';
         endif;
         return $redirect_url;
       }
       add_filter( 'wpmem_logout_redirect', 'my_logout_redirect' );
       ```
   

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘redirection after logout using wpmem_logout shortcode failed’ is closed
to new replies.

 * ![](https://ps.w.org/wp-members/assets/icon-256x256.png?rev=1226414)
 * [WP-Members Membership Plugin](https://wordpress.org/plugins/wp-members/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-members/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-members/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-members/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-members/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-members/reviews/)

## Tags

 * [shortcode](https://wordpress.org/support/topic-tag/shortcode/)

 * 2 replies
 * 2 participants
 * Last reply from: [ktakahisa](https://wordpress.org/support/users/ktakahisa/)
 * Last activity: [7 years, 7 months ago](https://wordpress.org/support/topic/redirection-after-logout-using-wpmem_logout-shortcode-failed/#post-10788988)
 * Status: resolved