Questions tagged [logout]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1 vote
0 answers
13 views

Nonce verification problem when logging in after a logout

I'm having a problem with nonce verification. The theme I'm using has an AJAX login form that has nonce as a hidden field. It normally goes to my account page after a logout, and I can re-login from ...
FlyingFish's user avatar
0 votes
0 answers
30 views

Logout and redirect WordPress user id without he refresh the page

I m developing a functionality triggered on a button $('.disconnect-classroom-button') when clicked, I logout all members inside that group, and the logout is done successfully ( but the user has to ...
yasinedr's user avatar
0 votes
1 answer
215 views

Unable to logout correctly after wp-login file was modified

I'm using a custom url for the login of my WordPress site. I've added this code in my functions.php file /** Hide default login */ function hide_default_login() { //Only proceed for guests if ...
ICTDEV's user avatar
  • 123
0 votes
1 answer
119 views

Changing login url

I've been following this guide on how to change your login url : https://www.malcare.com/blog/change-wordpress-login-url/ However, upon adding the logout, login and lost password hooks, I've noticed ...
dvm node's user avatar
0 votes
1 answer
109 views

Logout redirect via page template without confirmation?

I'm trying to redirect users when they visit my page template template-logout.php, but I keep getting the Wordpress "Do you really want to logout?" question despite wpnonce being generated. ...
Osu's user avatar
  • 1,442
1 vote
1 answer
612 views

Logout button in menu without "wp" in links

Update: This question was initially about how to log a user out without confirmation, but from a "pretty" URL without a logout nonce. However, in retrospect I realize this is a security ...
G.S.'s user avatar
  • 15
0 votes
2 answers
1k views

Can i hide a dynamically created div to logged out users?

Is it possible to hide a specific dynamically created div from user that is logged out? I have tried this but doesnt work: <?php if (is_user_logged_in()): ?> var element = document....
Ryan's user avatar
  • 5
0 votes
0 answers
21 views

Inconsistent login state

I'm logged in with "Remember me" checked. I then click the logout link. At this point I appear to be logged out - I can no longer access member-only pages, and menus that only appear for ...
Llaves's user avatar
  • 101
1 vote
2 answers
563 views

Force logout ALL users at a certain time

I'm wondering if it's possible to logout all users 2 times a day using the function wp_logout() ? I see loads of plugins who can logout idled users but we want to log out every single users twice a ...
Mand's user avatar
  • 111
0 votes
1 answer
504 views

add class to element if user is not logged in [closed]

Please help . I need to add class to this button if user is not logged in <?php echo apply_filters( 'my_order_html', '<button type="submit" class="ADD-CLASS-HERE cfw-primary-btn ...
Teymur Abbasov's user avatar
0 votes
0 answers
22 views

Multiple use wp_logout_url() on page cause 'header already sent' error after submit form

I am using two wp_logout_url() echoes on page. The first one is used in header.php custom theme file, second one is used in another page template file (page-[customslug].php). On that page i have a ...
X9DESIGN's user avatar
  • 159
0 votes
1 answer
228 views

wp_logout hook never triggered

Long story short. In wp-config.php: define('WP_DEBUG', true); define('WP_DEBUG_DISPLAY', false); define('WP_DEBUG_LOG', true); In the main file of my plugin, in the constructor: public function ...
assistbss's user avatar
  • 153
0 votes
1 answer
261 views

Check if user had autologin & if so, logout

I'm trying to create a function which autologins users, but upon visiting certain pages also performs an autologout if the initial login was obtained via autologin. I've written the following code but ...
BarrieO's user avatar
  • 89
0 votes
0 answers
198 views

Change auth_cookie_expiration for specific roles and specific login times

In my db i have a login counter that keeps a number value as a record (1,2,3,4,5...)every time a user from a specific role logins. I am trying to change the auth_cookie_expiration to 1 day for ...
Honoluluman's user avatar
0 votes
1 answer
732 views

How to hook a logout funtion for specific usr role in wordpress?

I am using plugin for login/logout(https://wordpress.org/plugins/login-logout-menu/) navigation link to be dynamic. Once user role logged in they will redirect to specific page and functionality is ...
mike's user avatar
  • 11
1 vote
1 answer
174 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 ...
arielsfr's user avatar
1 vote
2 answers
260 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'...
Debbie Kurth's user avatar
0 votes
2 answers
41 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) $...
Nigel Rodgers's user avatar
0 votes
2 answers
598 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 ...
seb's user avatar
  • 1
0 votes
2 answers
4k 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-...
Nick's user avatar
  • 127
1 vote
1 answer
474 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 ...
Theodore 's user avatar
0 votes
0 answers
188 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 $...
Luca Reghellin's user avatar
0 votes
1 answer
326 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/...
depar's user avatar
  • 3
0 votes
1 answer
382 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 ...
Filipe Rocha's user avatar
0 votes
0 answers
81 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 ...
Loader1's user avatar
1 vote
0 answers
83 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 ...
Bruce Banner's user avatar
1 vote
1 answer
1k 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 ...
horace's user avatar
  • 121
0 votes
0 answers
702 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 ...
Muhammad Yasir Asif's user avatar
0 votes
0 answers
32 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 ...
CharlieJustUs's user avatar
0 votes
1 answer
268 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 ...
Waqar Hussain's user avatar
0 votes
0 answers
53 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 ...
ellen's user avatar
  • 345
0 votes
2 answers
49 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 ...
SanSolo's user avatar
  • 103
0 votes
0 answers
128 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 ...
chris's user avatar
  • 1
1 vote
2 answers
2k 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 ...
Tai's user avatar
  • 13
0 votes
2 answers
647 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
D Singh's user avatar
2 votes
1 answer
1k 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 ...
i.brod's user avatar
  • 125
0 votes
1 answer
262 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 ...
Matteo Feduzi's user avatar
0 votes
2 answers
959 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&...
pehu's user avatar
  • 11
0 votes
1 answer
25 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 ...
Philipp's user avatar
0 votes
1 answer
1k 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 ...
akarim's user avatar
  • 305
0 votes
1 answer
2k 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 ...
hedgehogsweater's user avatar
0 votes
1 answer
669 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
nicolas181070's user avatar
1 vote
1 answer
339 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. ...
sanjay ojha's user avatar
2 votes
1 answer
562 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 ...
jkvgo's user avatar
  • 29
0 votes
1 answer
2k 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', '...
Pamela Ferguson's user avatar
0 votes
1 answer
43 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 ...
Robert Calceanu's user avatar
0 votes
0 answers
402 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 ...
Moose's user avatar
  • 292
1 vote
2 answers
1k 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#...
coolpasta's user avatar
  • 919
0 votes
1 answer
2k 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 ...
Scott 's user avatar
  • 101
3 votes
2 answers
7k 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
lllllllllllll's user avatar