Skip to content
Read For Learn
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP
Read For Learn
  • Database
    • Oracle
    • SQL
  • C
  • C++
  • Java
  • Java Script
  • jQuery
  • PHP

Woocommerce login not working on the first try

I have solved the issue. If you are having a strange validation problem that ONLY happens when you first load a page, and you have Woocommerce running on this particular site it might help you too.

Solution to my specific problem:

 /**
 * WooCommerce login not working on first try fix
 */
add_filter('nonce_user_logged_out', function($uid, $action) {
  if ($uid && $uid != 0 && $action && $action == 'woocommerce-login') {
     $uid = 0;
  }
   return $uid;
}, 100, 2);

More info about this issue here and here.

Related Posts:

  1. Remember page before login page, redirect to that page after login
  2. Woocommerce Login Redirect not working [closed]
  3. Redirect user after login through woocommerce login page to page with his/her username?
  4. Woocommerce Login Redirect to old domain
  5. wordpress/woocommerce login url not redirecting correctly
  6. Anonymous users can not access website
  7. How to use woo commerce login to authenticate code php pages?
  8. How to show woocommerce login / registration form in modal
  9. How to change redirect code? [duplicate]
  10. Login page so wide [closed]
  11. Remove login fields from /customer-account page [closed]
  12. Account Status/Login on Main Menu with Avatar Pictures
  13. How to modify username before logging in?
  14. Woocommerce – Add a product to cart programmatically via JS or PHP [closed]
  15. ( Woocommerce) How to get the user belonging to an order? [closed]
  16. Get the product list of a given Category ID
  17. How can I redirect user after entering wrong password?
  18. List of JS events in the WooCommerce frontend
  19. get woocommerce My account page link
  20. WooCommerce: How to edit the get_price_html
  21. Get woocommerce product price by id [closed]
  22. Product categories don’t appear as option to build menu
  23. WooCommerce Variable Product Price not showing on single product page
  24. How to override WooCommerce template files?
  25. Woocommerce add extra field to variation product
  26. Getting the gallery images from products in woocommerce?
  27. Custom login form
  28. How to get current product category ID in product archive page
  29. Get url of product’s images (woocommerce)
  30. WooCommerce prices location in DB
  31. Order by rating not works in wp_query
  32. Prevent wp_login_form() from redirecting to wp-admin when there are errors
  33. Woocommerce: How to remove page-title at the home/shop page but not category pages
  34. Woocommerce show cross sells on singe product page [closed]
  35. How to add a new endpoint in woocommerce
  36. Adding “Remember Me” in custom login
  37. Are there any hook or filter when refund is done through admin -woocommerce
  38. How to check if is in cart page? [closed]
  39. Display single product attribute value on Shop page (Woocommerce)
  40. How do I change the language of only the login page?
  41. Disable WordPress 3.6 idle logout / login modal window / session expiration
  42. Woocommerce registration page [closed]
  43. WP/WooCommerce REST API cart/checkout/order [closed]
  44. how to use wc_create_order with subscription product
  45. WooCommerce: Webhook disabled on its own
  46. Avoid to load default WP styles in login screen
  47. Share users and WooCommerce memberships between two installations
  48. How to fake a WordPress login?
  49. Slow Loading Attribute Select – WooCommerce Backend
  50. WooCommerce: Can’t use wc_get_products for custom REST API endpoints
  51. How to change or add Woocommerce thank you page URL key content?
  52. How build a custom login/register form with error handling?
  53. How can I define a custom template for woocommerce [products] shortcode? [closed]
  54. How to remove an action within a class with extends
  55. Can not login with correct username and password
  56. Custom ReCaptcha Login
  57. single-product.php template not working for single products [closed]
  58. Insert variations via woocommerce api [closed]
  59. WooCommerce get physical store address
  60. Is it possible to add custom fields to a WooCommerce attribute term? [closed]
  61. wc_get_template_part( ‘content’, ‘product’ ) | Where is this file located?
  62. how to get woocommerce product attribute slug
  63. Correct function to get the user’s latest Woocommerce Subscription?
  64. Move payment options at checkout in WooCommerce [closed]
  65. add_filter to modify woocommerce_cart_item_name hyperlink
  66. How can I add a custom script to footer of login page?
  67. Where do the cart details are stored in database?
  68. How to display product price of the product in loop
  69. Custom login form redirect to external site
  70. How to keep always logged in development environment
  71. How to disable Woocommerce password recovery and use the default WordPress password reset page?
  72. Display order items names in WooCommerce admin orders list [closed]
  73. WordPress AJAX Login Screen
  74. Is it safe to delete from db orphaned posts i.e. whose post_parent no longer exists?
  75. I want to disable E-Mail verifcation / activation when a user signs up for my WordPress site
  76. custom login page redirect to logged in user profile page
  77. Add custom variable to cart content [closed]
  78. Get product details by url key in WordPress woocommerce
  79. Get product link
  80. WooCommerce – Hook after Loading Variation in Admin Edit page?
  81. How to delete woo commerce order pragmatically? [closed]
  82. How can I modify the default reset (lost) password email text?
  83. WooCommerce changes lost password reset link
  84. Process checkout using WC REST API
  85. How to get rid of the hover zoom in WooCommerce single products
  86. How do I display certain products via their category on a section of a page using PHP?
  87. How to turn off WooCommerce user registration and manually create accounts?
  88. What’s the difference between WC() and $woocommerce
  89. Display orders instead of woocommerce my account dashboard for logged in users [closed]
  90. Limit users to one active subscription in WooCommerce Subscriptions? [closed]
  91. Detect whether a page is a product subcategory page?
  92. How to override wp-login.php
  93. Hidden woocommerce products still showing up in search results [closed]
  94. Menu not show woocommerce product category
  95. Change “You are now logged out” text
  96. Orders being sent to wrong admin email in WooCommerce [closed]
  97. Action wp_login_failed not working if only one field is filled out
  98. WooCommerce: add different order item meta for each item in order
  99. Woocommerce 3.1 Add product image to order confirmation email not working
  100. Where is the “default attribute” values located in the phpMyAdmin in Woocommerce?
Categories woocommerce-offtopic Tags login, woocommerce-offtopic, wp-login-form
difference between like ‘%%%var%%’ and ‘%var%’
WooCommerce – Reset quantity input field when variation changes

Recommended Hostings

Cloudways: Realize Your Website's Potential With Flexible & Affordable Hosting. 24/7/365 Support, Managed Security, Automated Backups, and 24/7 Real-time Monitoring.

FastComet: Fast SSD Hosting, Free Migration, Hack-Free Security, 24/7 Super Fast Support, 45 Day Money Back Guarantee.

Recent Added Topics

  • Bug in translation system: load_theme_textdomain() returns true, files are available and accessible but the language defaults to english
  • Post Navigation Elementor
  • Custom Elementor controls not appearing in the widget Advanced tab using injection hooks
  • WPFacet multiple loop displaying duplicate content
  • Get the name of the template/*html file used
  • Fix: WordPress.DB.PreparedSQL.NotPrepared Plugin Check (PCP)
  • Removing unnecessary CSS and JS code from wp_head()
  • hexagonal image gallery. Am I on the right track? [closed]
  • Trying to Add Paging to Single Post Page
  • Sharing media files between live and staging servers
© 2026 Read For Learn
  • Database
    • Oracle
    • SQL
  • algorithm
  • asp.net
  • assembly
  • binary
  • c#
  • Git
  • hex
  • HTML
  • iOS
  • language angnostic
  • math
  • matlab
  • Tips & Trick
  • Tools
  • windows
  • C
  • C++
  • Java
  • javascript
  • Python
  • R
  • Java Script
  • jQuery
  • PHP
  • WordPress