Moodle WordPress SSO: Single Login for Both Sites
Moodle WordPress SSO (single sign-on) lets a learner log in once on your WordPress site and land in their Moodle course already signed in. No second username, no second password, no “I can’t log in” emails after every sale.
Key takeaways
- Moodle WordPress SSO means learners log in once, on WordPress, and are signed into Moodle automatically.
- Without SSO, learners manage two passwords and you answer the support emails.
- Options range from OAuth 2 setups you configure yourself to plugins that handle it for you.
- In CourseTransit Pro, SSO is a single setting once WordPress and Moodle are connected.
This guide explains how it works, the main ways to set it up, and how CourseTransit Pro handles it.
Table of Contents
Why SSO matters when you sell courses
When you sell through WordPress and teach in Moodle, every learner has two places to log in. Without SSO, the journey after purchase looks like this: buy on WordPress, receive an email with Moodle details, find the Moodle site, log in again, and reset a password when it does not work.
Each step loses some people, and the ones who get stuck email you. With SSO, the learner clicks Open course on your site and is in.
How Moodle WordPress single sign-on works
Both sites need to agree on who the learner is. In practice:
- The learner logs in to WordPress.
- When they open a course, WordPress asks Moodle to sign them in, passing a short-lived, signed proof of who they are.
- Moodle checks the proof, matches it to the learner’s Moodle account and starts a session.
The learner still has a Moodle account, because Moodle stores their enrolments, progress and grades. SSO only removes the second login.
Two things most setups miss
Logging out. Most developers build the sign-in and forget the sign-out. Ending the session is just as important as starting one. If a learner logs out of WordPress but their Moodle session stays open, the next person on that computer can open Moodle as them. On shared or office computers, that is a real risk. Logging out of one site should log the learner out of both.
One login page. Pick one primary login page, usually WordPress, and always send learners there. Then hide the other one or redirect it. In Moodle, the Alternate login URL setting (Site administration > Plugins > Authentication > Manage authentication) sends anyone who reaches the Moodle login page to your WordPress login instead. Two different login pages confuse learners when they come back, and browsers save passwords against the wrong page. Keep a way for admins to get in if WordPress is down, such as resetting the setting from the server.
Ways to set it up
| Approach | How it works | Good for |
|---|---|---|
| OAuth 2 / OpenID Connect | Moodle’s OAuth 2 services trust WordPress (running an OAuth server plugin) as the login provider | Teams comfortable configuring identity settings on both sites |
| Identity provider for both | Both sites trust a third system, such as Microsoft Entra ID or Google | Organisations that already have company logins |
| Integration plugin | The plugin that connects WordPress and Moodle also handles the sign-in | Course sellers who want it to work without identity configuration |
The first two are flexible but need careful setup and testing, and they do not know anything about your WooCommerce orders. If you already use a plugin to sell Moodle courses, using its SSO is usually simplest.
SSO in CourseTransit Pro
Once CourseTransit connects your WordPress and Moodle sites, single sign-on is one setting.
- Go to CourseTransit > Settings > SSO.
- Turn on Enable Moodle SSO.
- Click Save Settings.

From then on, learners who open a course from your WordPress site are signed into Moodle automatically. The enrolment created at purchase and the sign-in use the same account, so there is nothing to match up by hand. Logging out works the same way: when a learner logs out of WordPress, CourseTransit ends their Moodle session too.
SSO is part of CourseTransit Pro, alongside bundles, bulk seat purchase and automatic course sync. See how to sell Moodle courses with WooCommerce for the full setup.
Test it properly
Before you tell customers, test with a fresh account:
- Buy a course as a new customer.
- Open the course from the WordPress site and confirm you land in Moodle signed in.
- Log out of WordPress, then open Moodle in the same browser. You should be signed out there too.
- Repeat from a private browser window.
- Try an existing learner who already had a Moodle account before you turned SSO on.
If something fails, Settings > Logs in CourseTransit records connection and sign-in errors.
Security basics
- Use HTTPS on both sites. SSO should never run over plain HTTP.
- Keep both sites on supported, updated versions of WordPress, Moodle and the plugins involved.
- Restrict who can change SSO settings to administrators.
- If learners also need company logins through Microsoft or Google, see Moodle SSO with Azure AD, Google and SAML.
Frequently asked questions
Sell your Moodle courses from WordPress
CourseTransit syncs Moodle courses into WooCommerce and enrols buyers automatically. The free version covers syncing, selling and enrolment.
About the author: Himanshu Saini
Founder of JustAddWater and Moodle LMS architect. 13+ years building and supporting Moodle and IOMAD learning platforms, and AI integrations.
