Questions tagged [logout]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
3
votes
2answers
7k views

wp_logout Not Logging Me Out

Here is what I'm doing: wp_logout(); var_dump(is_user_logged_in()); var_dump returns: bool(true) Why is wp_logout() not logging me out?
0
votes
1answer
21 views

Logout user if click on a custom page link

I want to logout a user if the user click on custom page link (e.g. example.com/logout). I need to do that because my site users are not allowed to access wp-login.php page. I've a front-end login ...
0
votes
1answer
17 views

Change Login or Logout text based on status

I'm trying to display text in a button in the header that says "LOG IN" or "LOG OUT" depending on the visitor's status. The button calls a slider action, so I just need to change the text displayed on ...
0
votes
1answer
666 views

How to ristrict browser back button after logout?

I'm facing a issue from couple of days, after logout user can view the login user history details using browser back button, so how could I resolve this issue. Could you suggest me to solve this issue ...
0
votes
1answer
676 views

wp_logout problem

I have added custom page '/member-logout/' in nav walker for user logout. When activated then the function 'render-logout' is fired function render_logout() { if ( is_user_logged_in() ){ ...
1
vote
1answer
703 views

After logout browser's back button into twenty sixteen theme profile

I have tried numerous ways to prevent the browser's back button from allowing someone from using it to go back into a visitors logged out profile. The codes I used were supposed to prevent the browser ...
-1
votes
1answer
54 views

Woocommerce - auto logout after payment

I need to automatically logout user/customer after payment, every time that a customer or user close browser, he auto logout
0
votes
0answers
15 views

Session Experies and Get Logged Out Within Few Minutes

I have wordpress simple blog with few plugins installed. My problem is that after logging and working for few minutes (hardly 2-5 minutes), session expires and I get logged out of the admin area. ...
0
votes
2answers
2k views

how to refresh page after user logout with 'wp_logout_url'?

I have written a plugin for my own site where I have an issue like "after user login to the site if he logout then again if he clicks on browser back button then the previous page showing again ...
2
votes
1answer
65 views

wp_logout() changes in WordPress 5.1.1

We've recently just upgraded our WordPress site to 5.1.1 After the upgrade, we've started encountering issues when executing the wp_logout() function of WordPress. Somehow we're getting a 302 ...
0
votes
0answers
14 views

Uploading images causes LogOut

We are experimenting an peculiar problem randomly when we upload an image. No matter the size or kind of image this will trigger a logout to every user that is uploading in a post the images. We ...
5
votes
1answer
10k views

Destroy user sessions based on user ID

I want to programatically log a specific user out of our WordPress system based on their user ID much like the 'Log Out of All Sessions' button in the WordPress user editor section. How am I able to ...
6
votes
4answers
9k views

How to change the default logout link on WordPress Admin

I want to use another link for logout because I have /wp-admin/* protected with htpassword. Is there a way to do this? Something like creating a custom page like site.com/logout then use it as my new ...
11
votes
3answers
54k views

How to log out without confirmation 'Do you really want to log out?"?

Right now when I log out via: <a href="<?php bloginfo('url'); ?>/wp-login.php?action=logout">Log out</a> it redirects me to the page where I need to confirm the log out. How to ...
0
votes
1answer
230 views

Logout without confirmation and SAME window on mobile

I using this code to logout. It works except on mobile it opens a new window. How can I logout with confirmation and redirect to to the same window? add_action('check_admin_referer', '...
1
vote
2answers
3k views

share login/logout sessions across two installs?

I'm having some issues sharing the user sessions across two installs. (a) site on http://stolenmx.com (b) site on http://arcade.stolenmx.com I have installed B in the same database as A and I have ...
0
votes
1answer
23 views

How do I replace “Log Out” from the Menu with “My Orders”?

After the user clicks on Log In, the Log In option changes to Log Out in the menu. How can I make it change to My Orders instead, redirecting to /my-account/orders/? So basically now it's changing ...
0
votes
0answers
145 views

wp_logout() not working after form submission

I am pretty new to Wordpress, so please forgive me if this sounds like a silly question. I have a Wordpress Page which is using the default page.php template in my theme. I modified the page.php ...
3
votes
4answers
4k views

How change wordpress password without logout ( need for plugin )

I need change WP password without logout profile. When I use wp_set_password( $password, $user_ID ) i have problem with logout.
0
votes
3answers
1k views

How to remove 'wordpress…' text from page titles in tabs

I am working on a site and sometimes I run into an error when logging out and on the site tab it says 'Wordpress Failure Notice'. I am trying to remove all instances of wordpress so users dont know Im ...
4
votes
1answer
3k views

WordPress failure when logging out

I have came across the WordPress logout error several times but I really never figured out the cause of it. In earlier days, it was generally that I was missing a nonce but now even with logout link ...
1
vote
1answer
200 views

How would I hook into `clear_auth_cookie` to return the user's ID that's currently being logged out?

clear_auth_cookie is what I'd need in order to catch the actual logout action, but I can't get it to return anything. https://core.trac.wordpress.org/browser/tags/4.9/src/wp-includes/pluggable.php#...
0
votes
2answers
2k views

Set Short Automatic Logout Time for One User

I am building sites where I secretly give authoring role capability to visitors by auto-logging them into a generic account; they never see the admin bar, and are prevented from seeing the dashboard (...
0
votes
1answer
391 views

Logout redirects to default page

New to wordpress and not a php developer, but I'm currently having an issue with a user being redirected to a default wordpress page and being asked to confirm if the user wants to log out twice. I ...
2
votes
1answer
2k views

How to log out everywhere else, destroy all sessions “all other devices”?

WordPress panel service "log out everywhere else" is doing a nice job. I want to use this as a function outside the panel. Screenshoot
0
votes
1answer
180 views

Why deleting/removing cookies in WordPress does not log me out from admin?

I am really curious and I haven't found satisfactory answer in similar questions. When deleting all of my cookies, I am still perfectly able to access my admin dashboard - why am I not returned back ...
0
votes
0answers
797 views

Changing the WP login session cookie time?

As i know, WordPress makes login session cookie expire in 48 hours or on browser close. And in 14 days, if we check the "Remember Me". I want to change this time to 5 seconds: function ...
0
votes
1answer
515 views

How to Show Different Menus to Logged in Users in WordPress [duplicate]

how to write code for this requirement and i want to show menus only in header menu with different menus to logged users
0
votes
1answer
95 views

add the user name to menu when user is logged in [closed]

i have this code but its not working it throws syntax error, unexpected '}' error function my_custom_menu_item($items, $args) { if(is_user_logged_in() && $args->theme_location == '...
1
vote
1answer
232 views

Update user meta on logout

I have seen some answers, but the questions are quite a number of years old, and the after trying their responses I've not been able to get it to work. I need to update user meta data during the ...
5
votes
4answers
10k views

Logout redirect to current page - function

I'm looking for a function that can redirect users when they logout to the current page. I'm looking for a code I can use in functions.php?
3
votes
3answers
1k views

Change “You are now logged out” text

I want to wrap <strong></strong> around the words "logged out": add_filter( 'gettext', 'wpse17709_gettext', 10, 2 ); function wpse17709_gettext( $custom_translation, $login_texts ) { ...
0
votes
1answer
2k views

Logout Redirect and also WP-login.php Redirect

I am not very advanced in php. I have this function that prevents wp-login.php access with redirection add_action('init','custom_login'); function custom_login(){ global $pagenow; if( 'wp-login.php' ...
0
votes
3answers
9k views

How to redirect logged out users to specific page?

I have a question and a technical issue in wordpress. That is, i have a login form on my website to allow visitors to login to see special content. The question goes here, when the time they log in, i ...
1
vote
3answers
3k views

add logout button on admin side menu

I want to add a logout button on the side admin menu (because I disable the admin bar for the users). So I thought add_menu_page() is the way to do it, but how to add the link to the regarded function?...
0
votes
1answer
94 views

Redirection of wp-login.php results in non working of Logout process

I want to create Custom Login, Registration, Password Reset & Logout Page. For that I have added following code in my function.php file. function custom_login_page() { $new_login_page_url = ...
0
votes
1answer
60 views

WordPress session times out - but doesn't log out?

Since migrating our WordPress site to a new webserver, we have had issues where users are apparently getting logged out...but yet aren't. What I mean is, on our old server, users would sometimes get ...
2
votes
1answer
1k views

Logout issue with new Domain on WP Multisite

I'm using a multisite and I set my site up at parentsite.com/mysite. When the logout button was clicked it worked correctly and logged the users out and brought them back to the homepage. Here's what ...
0
votes
0answers
64 views

wp_logout_url($uri) having two redirect values

$uri= $_SERVER['REQUEST_URI']; wp_logout_url($uri) having two redirect values like this http://localhost/sarkari/wp-login.php?action=logout&redirect_to=%2Fsarkari%2F&_wpnonce=b5e3b954df&...
2
votes
2answers
409 views

Logout via Subdomain, non-wordpress page on a different server?

Similar to the question over at Get wp_logout_url function to work on external (non-Wordpress) page The problem I am facing is the fact the subdomain is on a different server so I am unable to ...
1
vote
2answers
221 views

Is there any way to check for user login and send him to login?

I have written a plugin for my own site where I have an issue like "after user login to the site if he logout then again if he clicks on browser back button then the previous page showing again ...
-1
votes
1answer
2k views

Need edit profile link in the menu for logged in users

I have a page called edit profile, i have installed the profile builder plugin,so the users can edit their profile from front end, if the user is logged in i want to show the edit profile and logout ...
1
vote
2answers
1k views

wp_logout not redirecting using wp_logout_url() and wp_redirect()

I have written this function for loggin user out. The user is loggin out but not redirecting to the page instead goes to home page which default logout Url. i have tried wp_logout_url() and also ...
1
vote
1answer
2k views

Logout using link (without nonce)

This question comes from an absolute non-coder - and has been asked in various forms several times befor (e.g. here). To logout properly the URL that triggers it needs a nonce as e.g.: http://xyz/...
4
votes
1answer
5k views

Masking logout URL

The primary goal is to hide that the site is driven by wordpress. I've got the login part all locked up, but the logout URL still has those blasted wp delineators that give away it's a wordpress site. ...
0
votes
1answer
458 views

login logout menu changes in wordpress [closed]

I am new to wordpress ,i use login and logout in my site,i already create pages for login , logout and register ,i wants to create 2 menu in navigation bar . one for register and another one for login ...
0
votes
1answer
106 views

get_permalink not fetching correct pages

I am developing a WP site locally on Xampp. I am using the following code to add a styled login/out button to the sidebar: add_shortcode( 'my_login', 'my_login' ); function my_login() { if (...
11
votes
1answer
11k views

How reduce wordpress login session timeout time?

I want to logout user autometically when user is idle for more than 10 minutes.That mean suppose user is logged in to a site and user didn't browse any pages for more than 10 mins.when he browse any ...
3
votes
2answers
2k views

wp_logout action not working

I'm trying to remove some cookies set to control persistent login when the user specifically wants to log out of a website. I thought it would be as simple as: function remove_user_cookie() { ...
1
vote
2answers
3k views

Deleting cookie to logout

Would be potential problems if I delete wordpress_logged_in_47d1523b... cookie using javascript? Is there something additional that wp_logout does?