LifterLMS Login Loop and Redirect Loop Fixes

Find and fix the cause of a LifterLMS login loop or "too many redirects" error: Force SSL, membership restriction redirects, cookie and domain mismatches, caching and security plugins.

  • Add as a preferred source on Google
Illustration for “LifterLMS Login Loop and Redirect Loop Fixes”

Students log in and land straight back on the login form. Or the browser gives up with "too many redirects" when anyone opens the dashboard, the checkout or a course. A LifterLMS login loop locks people out of what they paid for, so it needs fixing quickly, and it needs fixing at the cause rather than by clearing caches until it goes away.

This guide explains the two kinds of loop, the settings in LifterLMS that can create one, and the server, cookie and plugin problems behind the rest. Each section ends with the fix. If you need to set up login pages and redirects from scratch rather than fix them, read LifterLMS login and redirects first.

Two kinds of loop

  • A hard redirect loop. The browser shows ERR_TOO_MANY_REDIRECTS or "This page isn't working". The server keeps sending the browser from one URL to another and back. The cause is a rule on the server or in a plugin, and it usually affects everyone.
  • A login loop. The login form accepts the password, the page reloads, and the student still looks logged out. No error, just the form again. This is a cookie or caching problem: the login worked, but the next page does not see it. It often affects some users or some browsers only.

Tell them apart first, because the fixes are different. You can see a hard loop's chain from a terminal:

curl -sIL https://example.com/dashboard/ | grep -iE "^(HTTP|location)"

A list of alternating locations, for example between http:// and https:// or between two pages, tells you exactly which rule is fighting which.

Cause 1: The Force SSL setting

LifterLMS has a Force SSL checkbox under LifterLMS > Settings > Checkout, described as "Force secure checkout via SSL (https) on the checkout page(s)". When it is on, LifterLMS does two things:

  • On the checkout and student dashboard pages, if the request is not seen as HTTPS, it redirects to the HTTPS version.
  • On every other page, if your WordPress home URL is http:// and the request is HTTPS, it redirects back to HTTP.

Both rules depend on WordPress correctly detecting HTTPS. Behind a load balancer, a CDN such as Cloudflare or some managed hosting proxies, the visitor uses HTTPS but PHP sees plain HTTP. The first rule then redirects to HTTPS forever. If your host also forces HTTPS while the WordPress address is still http://, the second rule sends visitors back to HTTP and the host sends them to HTTPS again.

The fix: if your whole site already runs on HTTPS, which it should, turn Force SSL off. The LifterLMS SSL documentation warns that enabling it when the site address is already HTTPS can cause a redirect loop. Make the WordPress Address and Site Address HTTPS under Settings > General instead. If you cannot reach the dashboard, turn the setting off with WP-CLI:

wp option update lifterlms_checkout_force_ssl no

If PHP does not see HTTPS behind your proxy, fix that too, or other plugins will loop in the same way. The WordPress HTTPS handbook page gives the wp-config.php snippet that sets $_SERVER['HTTPS'] from the X-Forwarded-Proto header. Our guide to HTTPS and mixed content in LifterLMS covers the full move to HTTPS.

Cause 2: Membership restriction redirects

LifterLMS can redirect non-members away from restricted content. Done carelessly, the redirect points at something that is itself restricted.

Restrict site by membership level

The Restrict site by membership level setting under LifterLMS > Settings > Memberships locks the whole site to one membership. LifterLMS automatically lets non-members reach a short list of pages so they can still join:

  • the membership's own page
  • the memberships catalog page
  • the student dashboard page
  • the checkout page
  • the terms and conditions page and the WordPress privacy policy page
  • the page chosen as the membership's redirect, when the redirect type is a WordPress page

Anything else is restricted. If the membership's Restricted Access Redirect is set to Redirect to a Custom URL and that URL is a page on your own site, such as your home page or a sales page, that page is not on the list. Visitors are restricted there too and redirected again, to the same place, forever.

The fix: use Redirect to a WordPress page for an on-site landing page, so LifterLMS adds it to the allowed list, or Redirect to this membership page. If you need more pages open, such as a contact page, a developer can add their IDs with the lifterlms_sitewide_restriction_bypass_ids filter:

add_filter( 'lifterlms_sitewide_restriction_bypass_ids', 'llmsx_open_pages' );
function llmsx_open_pages( $ids ) {
	$ids[] = 42;  // Contact page.
	$ids[] = 57;  // About page.
	return $ids;
}

To unlock the site in an emergency, clear the setting:

wp option update lifterlms_membership_required ""

Membership redirects on individual pages

The same problem appears on a smaller scale when a page or post is restricted to a membership and the membership redirects to another page restricted to the same membership. Map out where each restriction sends people before you launch. Our guide to restricting pages and posts in LifterLMS explains the options.

A login loop without an error is usually a cookie that the browser will not send back.

  • www and non-www. If the WordPress Address and Site Address differ (one with www, one without), or a link takes students to the other version, the login cookie is set for one host and the next page is on the other. Make both addresses identical and redirect the other host to it at the server.
  • HTTP and HTTPS mixed. When someone logs in over HTTPS, WordPress sets a secure login cookie that the browser will not send over plain HTTP. If any page or menu link still points to http://, the student looks logged out there. Serve the whole site over HTTPS.
  • A custom COOKIE_DOMAIN. A wrong value in wp-config.php, often left from a multisite or a previous domain, stops cookies from being saved. Remove it unless you know you need it.
  • Browser privacy settings. If the course is embedded in an iframe on another site, browsers treat its cookies as third-party and may block them. Link to the course instead of framing it.

Cause 4: Caching

A page cache that stores the dashboard page or a redirect response serves the same thing to everyone. A logged-out copy of the dashboard looks exactly like a login loop.

  • Exclude the student dashboard, checkout and all course, lesson and quiz pages from page caching for logged-in users. See our guide to LifterLMS caching conflicts for the full list.
  • CDN rules that cache HTML by default must bypass the cache when WordPress login cookies are present.
  • Browsers cache permanent (301) redirects. After you fix a Force SSL or www loop, test in a private window or clear the browser cache, or you will still see the old loop.

Cause 5: Security and login plugins

LifterLMS core does not redirect students away from wp-admin or wp-login.php, but many plugins do. Loops appear when two of them disagree:

  • A plugin that hides wp-login.php and a plugin that redirects logged-out users to it.
  • A "redirect after login" rule that sends students to a page another rule sends logged-in users away from.
  • A membership or role plugin restricting the LifterLMS dashboard page to a role your students do not have.
  • Two-factor or session plugins with short timeouts that log students out on every request.

Also check the LifterLMS Prevent concurrent logins setting under LifterLMS > Settings > Accounts. It keeps only the most recent login for the chosen roles. A student who uses a phone and a laptop at once, or whose browser keeps two tabs fighting, will keep being logged out. That is the setting working as designed, but it can look like a loop.

Find the redirect that is looping

When the cause is not obvious, log every redirect WordPress makes. Add this temporarily to a must-use plugin on staging, or on production for a few minutes, with debug logging enabled:

add_filter( 'wp_redirect', 'llmsx_log_redirects', 999, 2 );
function llmsx_log_redirects( $location, $status ) {
	error_log( sprintf(
		'Redirect %d to %s from %s via %s',
		$status,
		$location,
		isset( $_SERVER['REQUEST_URI'] ) ? $_SERVER['REQUEST_URI'] : '',
		wp_debug_backtrace_summary()
	) );
	return $location;
}

The backtrace names the plugin or function that issued each redirect. Redirects from LifterLMS restrictions come from the template loader; filters such as llms_restricted_by_membership_redirect let a developer change them. Remove the logger when you are done.

If the log stays empty while the loop continues, the redirect is not coming from WordPress at all. Look at the server configuration, .htaccess, the host's control panel and the CDN.

Frequently asked questions

Why does the LifterLMS login form keep reloading?

The login works but the next page does not see the login cookie, or a cached copy of the page is shown. Check that the site uses one domain and HTTPS everywhere, then check page caching.

Should I enable Force SSL in LifterLMS?

Only if your site address is still HTTP and you want HTTPS on checkout only. A modern site should run entirely on HTTPS with Force SSL off.

Can I change where students go after logging in?

Yes. The LifterLMS login form sends students to the dashboard by default, and the lifterlms_login_redirect filter lets a developer change the destination.

What to do next

Identify which kind of loop you have, then check the two LifterLMS settings first: Force SSL and the sitewide membership restriction. Most hard loops on LifterLMS sites start there. For login loops, line up the domain, HTTPS and caching.

If students are locked out right now and you cannot find the rule responsible, our LifterLMS support team traces redirects on live sites, and our consulting service can review your access and redirect design before launch. Contact us with the URL that loops.

Add LifterLMS Expert to your preferred sources

Add lifterlmsexpert.com as a preferred source on Google, or open this article in your AI assistant to use it as a source.

  • Add as a preferred source on Google
Free consultation

Prefer expert help over DIY?

Skip the trial and error. Get specialist LifterLMS help and ship faster.

Talk to a LifterLMS Expert Explore our services

Replies within one business day