Questions tagged [logout]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
23 views

Logout users upon login, based on caps/role?

To reduce spam registrations, users are assigned the pending role until they're vetted (at which point they're assigned the subscriber role). The pending role has no capabilities. When pending users ...
0
votes
2answers
12 views

Getting User email on logout. wp_logout

I have looked at a couple of different ways to check when a user, of a particular role, has logged out. The call is made within a plugin. In the main loop I have the following: add_action( 'wp_logout'...
0
votes
2answers
26 views

Lock out all WordPress Administrators except two specific users

I used the snippet below to lock out all administrators and editors except myself if ( is_user_logged_in() ){ $current_user = wp_get_current_user() ; if ( in_array( 'administrator', (array) $...
0
votes
0answers
11 views

wp_logout without redirect

I am creating my own login page, and checking if the user is logged in. If so, calling wp_logout before rendering my page. This works, but I do get warnings as Wordpress is trying to redirect me. ...
0
votes
2answers
23 views

Woocommerce, prevent login after registration and redirect to custom URL

I'm looking for a way to prevent the automatic login after registration (i.e. by logging him out after registration) and redirect him to a custom URL. So far I'm only able to do both of them ...
0
votes
2answers
103 views

Log out without confirmation request (nonce)

I have a Wordpress site with WooCommerce. I would like to add a Logout option to the Menu that logs out the user without asking for confirmation. So I included a menu custom link with as URL: /my-...
0
votes
0answers
21 views

Blacklisting jwt after logout in wordpress

I need to blacklist jwt after logout. Does anyone implemented it in in wordpress and could share his approach? What I’ve thought of is storing blacklisted user jwt in user meta (value and expiration ...
0
votes
1answer
67 views

Auto redirect after session expire, but only for one user

Does anyone have an insight as to how I could auto redirect only one user instead of for everyone when a session times out? IE user - paul when his session times out, takes him to XYZ.com/page instead ...
0
votes
0answers
19 views

How to logout the current user without notices and warnings?

I'm trying to avoid that subscriber users had access to admin. I'm using the following code: add_action( 'admin_init', 'lr_no_admin_u_access', 100 ); function lr_no_admin_u_access() { global $...
0
votes
1answer
45 views

How to hide “You are now logged out” message on Wordpress login form?

Expectation: I want to hide the login message that shows up on the Wordpress login form after a user has logged out. Added screenshot of the message that I am trying to hide. https://i.imgur.com/...
0
votes
1answer
100 views

Change button link to add nonce

I am making a Logout button, but in order for it to work properly the link needs to have the correct nonce ("site.com/wp-login.php?action=logout&wp_nonce=X". I have found in another ...
0
votes
0answers
29 views

Problem with is_user_logged_in() function in some pages

I faced a problem with this function is_user_logged_in() in the header to test if the user is logged in to some code. Its working just in some pages like homepage but the other sub-pages not I don't ...
1
vote
0answers
28 views

Wordpress Keeps Logging Out - What Tests Can I Run to Solve This?

I keep getting logged out of wordpress randomly. Despite having set long "Remember Me" times etc. I am still being required to log back in when I re-open my browser and whilst in admin, I randomly get ...
1
vote
1answer
488 views

wp_logout_url() redirects to confirmation page even with nonce?

I use wp_logout_url() to output a logout link. How can I avoid displaying the confirmation page that appears after clicking the link? <a href="<?= wp_logout_url(get_permalink()); ?>">Log ...
0
votes
0answers
513 views

logout error “something went wrong”

I have add a link of logout in menu using wordpress default menu like this http://example/wp-login.php?action=logout it redirects me to logout confirmation but after clicking on logout in confirmation ...
0
votes
0answers
24 views

How to add Loginout to Sub-menu

I've been searching all over the interwebs for this one. I've got the code snippets to add Loginout to a menu as a main menu item. I'm now looking to understand how to attach it to a sub-menu. This is ...
0
votes
1answer
133 views

Logout after clicking URL link results in “headers already sent” error

Warning: Cannot modify header information - headers already sent by (output started at D:\xampp\htdocs\wordpress\wp-includes\formatting.php:5688) in D:\xampp\htdocs\wordpress\wp-includes\pluggable.php ...
0
votes
0answers
37 views

Unable to update plugins or log out

The server my site was hosted on recently went down and someone else was able to fix it for me. I am unclear on what exactly the issues with the server were, but since the site came back up, my cron ...
0
votes
2answers
22 views

How to redirect returning users who previously logged in?

There are many answers to how to redirect after login. But my situation is different. In my scenario, we have a landing page where people can login. Once logged in, the users are not logged out for a ...
0
votes
0answers
55 views

How to make Logout Link consistently appear on all web pages?

I am using the following code to add Log In and Log Out links in the Primary Menu. Can't give a web link because the site is still under construction. //* Add a Login/Logout toggle item in WordPress ...
1
vote
2answers
678 views

Hook to change Logout url

I used this hook to replace the exit address . Now, unfortunately, this hook does not work and I can not understand why add_filter('logout_url', 'my_custom_logout_url'); function ...
0
votes
1answer
255 views

Logout all users at particular time

How can I logout all users in wordpress at specific time? I tried to create a hook and used WP Control plugin but it did not worked for me
2
votes
1answer
768 views

Logout redirects to a broken page(home URL is omitted)

I'm using the latest version of WP. I have a problem, where clicking the logout button from the admin panel redirects to a completely broken link: http://wp-login.php/?loggedout=true As you can ...
0
votes
1answer
47 views

What is the link to log out on Wordpress?

I have a custom login form that takes the code from wp-login.php. I can't use wp-login.php because when this file is used I refer them to my main login file, ie login.php. Is there therefore a link ...
0
votes
2answers
448 views

logging out with/without confirmation - single site, multisite

I have two wordpress installations: a single one and a multisite with subdirectories. On both my users can logout with the url: [URL to]/wp-login.php?action=logout&redirect_to=%2Fmydir%2F&...
0
votes
1answer
21 views

Automatically Log Out UserX when visiting WooCommerceStore

I developed a Web-Plattform, and Users Log into a DemoUser in order to Check-Out the Dashboard functionality. Now the problem is, that once they are happy with what they see and visit the ...
0
votes
1answer
288 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
724 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
421 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
1
vote
1answer
66 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. ...
2
votes
1answer
360 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
1answer
1k 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', '...
0
votes
1answer
34 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
278 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 ...
1
vote
2answers
731 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
1answer
1k 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
5k 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
1k 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
149 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 == '...
0
votes
1answer
253 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
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' ...
1
vote
1answer
561 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 ...
0
votes
1answer
140 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
80 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 ...
0
votes
0answers
103 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&...
1
vote
1answer
1k 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 ...
0
votes
1answer
1k 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
909 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() ){ ...
0
votes
2answers
3k 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 ...
1
vote
2answers
410 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 ...