How to connect WordPress memberships to Discord
WordPress does not natively sync membership status with Discord. The manual method is to invite members and manage Discord roles yourself; automatic role changes require a membership integration, bot, or custom API work. If you use Paid Memberships Pro, a Discord add-on is the quickest route.
- 01Plan your Discord access rules
- 02Use the manual route if needed
- 03Create the Discord application
- 04Connect the Discord bot
- 05Map memberships to roles
- 06Add the member connection step
- 07Choose the fast way
What you need
- A WordPress membership plugin with active membership levels
- A Discord server where you can manage roles
- Administrator access to WordPress and Discord
- A test member account
Plan your Discord access rules
Decide which membership levels should receive access and whether each level needs its own Discord role. In Discord, create roles such as Member, Premium or Student, then give those roles permission to view the private channels they should access.
Decide what should happen when a member cancels, expires or changes level. Removing the role is safer than leaving former members in private channels, but you may prefer a limited former-member role for a grace period.
Use the manual route if needed
For a small community, the manual method is workable. Create a controlled Discord invite, send it only to logged-in members, and assign each member's Discord role after checking their WordPress membership level. Keep a simple record of the WordPress user, Discord username and assigned role.
Review cancellations, failed renewals and membership changes on a schedule, then remove or change Discord roles yourself. This costs no integration setup, but it is easy to miss a change and it does not scale well.
Create the Discord application
For automatic syncing, you need a membership integration that can authenticate a member's Discord account and use a bot to manage server roles. With Paid Memberships Pro, install a compatible Discord integration from Plugins > Add New, then open its Discord settings.
In the Discord Developer Portal, create an application and copy its OAuth2 Client ID and Client Secret. Copy the Redirect URL shown in the WordPress settings into the application's OAuth2 redirect settings. The documented PMPro setup uses these values to connect member accounts to Discord.
Connect the Discord bot
Create or open the application's bot in the Discord Developer Portal and copy its bot token into the WordPress integration settings. Enable Developer Mode in Discord, right-click your server and copy its Server ID or Guild ID into WordPress.
Use the integration's connect or authorise button to add the bot to the correct server. Keep the bot token private. If the wrong server is selected, or the Server ID and authorised server do not match, the connection can appear successful while role updates fail.
Map memberships to roles
In the integration's role-mapping screen, match each WordPress membership level to one Discord role. Put the bot's role above every role it must assign in Server Settings > Roles. Discord bots cannot manage roles placed above their own role in the hierarchy.
Set the private channel permissions against the mapped roles, not individual users. The common Friday problem is a Missing Access error caused by the bot role being too low. Another frequent issue is expecting an instant change when the integration processes Discord API tasks on a schedule.
Add the member connection step
Members normally need to connect their WordPress account to their own Discord account before the site can assign the correct role. Test this with a separate member account: complete or assign a membership, open the membership account area, choose the Discord connection option and confirm that the user appears in the server with the mapped role.
With Paid Memberships Pro, the documented integration can show a connect or disconnect button on the profile area. Its [discord_connect_button] shortcode can also place that button elsewhere, preferably inside a membership-restricted area.
Choose the fast way
If you use Paid Memberships Pro, install Connect Paid Memberships Pro to Discord rather than building the Discord API connection yourself. It maps membership levels to Discord roles and can update or remove roles when memberships change, expire or are cancelled. You still need to create the Discord application, authorise the bot, set the role hierarchy and test the member connection.
This is the sensible route for a gated community because the difficult parts are account linking, role changes and expiry handling. A custom integration is only worth considering when your membership rules or Discord workflow do not fit the available add-on.
Let Connect Paid Memberships Pro to Discord do it
Automatically assigns Discord roles by membership level; ideal for gated communities using Paid Memberships Pro.
Sources
- paidmembershipspro.com /set-up-members-only-discord/
- github.com /expresstechsoftware/pmpro-discord-add-on
- wordpress.org /support/?p=16990690&utm_source=openai
Questions
- Can WordPress connect to Discord without a plugin?
- Not for automatic membership-based role syncing. WordPress can link to Discord only when code or an external service handles OAuth authentication, membership events and Discord's bot API. Without that work, your practical no-plugin option is to send members an invite and assign or remove Discord roles manually.
- Do members have to connect their own Discord account?
- Yes, in the usual setup each member must authorise their Discord account so WordPress can identify the correct Discord user. A server invite alone does not reliably tell WordPress which Discord account belongs to which WordPress member. Test the connection flow with a separate account before opening it to customers.
- Why is the Discord role not being assigned?
- The most common causes are an incorrect Server ID, an unauthorised bot, a member who has not connected Discord, or a bot role that sits below the role it must assign. Check the integration log, confirm the bot is in the right server and move its role above the mapped roles. Some integrations also process updates on a schedule rather than immediately.
- What happens when a membership expires or is cancelled?
- A suitable membership integration can remove the mapped Discord role, change it to a default role or leave the member in the server according to its settings. You must decide this policy before launch. If you manage the process manually, review cancellations and failed renewals regularly because Discord will not know about WordPress membership changes by itself.
- Can one Discord role be used for several membership levels?
- Yes, several membership levels can represent the same access tier, provided your integration supports that mapping. However, separate roles are better when levels need different channels or benefits. Map the role permissions in Discord carefully, because changing one shared role changes access for every membership level using it.