Skip to content

Groundhogg Automations

How to Remove a WordPress User Role When a Groundhogg Tag Is Removed

When a member leaves, their access should follow. If you manage membership with a Groundhogg tag, Zapify can take the matching WordPress role away as soon as the tag is removed, using the A tag is removed from a contact trigger and the free Remove a role from a user action. Groundhogg is a Zapify PRO integration.

What this automation does

The automation is one trigger plus one action:

  • Trigger: A tag is removed from a contact (GROUNDHOGG_TAG_REMOVED, Groundhogg)
  • Action: Remove a role from a user (WP_REMOVE_USER_ROLE, WordPress)

When the tag you choose is removed from a contact that belongs to a WordPress account, Zapify removes the role from that account.

The contact needs a WordPress account

A role can only be removed from a WordPress user. If the contact is not linked to a WordPress account, the run is skipped with a message that the action needs a user. Zapify also refuses to remove a user's only role, so make sure the user keeps at least one other role, such as Subscriber.

PRO feature

Groundhogg is a Zapify PRO integration. The Groundhogg trigger used in this automation needs an active Zapify PRO licence.

Before you start

How to build the automation

Step 1: Create a new automation

  1. In the WordPress admin, go to Zapify → Automations.
  2. Click Add New to open the builder.
  3. Name it clearly, such as Revoke member role when tag is removed.

Create a new automation

Step 2: Add the "A tag is removed from a contact" trigger

  1. Click Add Trigger.

Add a trigger

  1. Choose Groundhogg as the app.

Select Groundhogg as the trigger app

  1. Select the trigger A tag is removed from a contact.

Select A tag is removed from a contact

  1. Configure the trigger:
Field Required What it does
Tag Yes Pick the tag to watch, or leave it on Any tag to run whenever any tag is removed.

Step 3: Add the "Remove a role from a user" action

  1. Click Add Action.

Add an action

  1. Choose WordPress as the app.

Select WordPress as the action

  1. Select Remove a role from a user.

Select Remove a role from a user

Step 4: Configure the action

Field Required What it does
User No Leave empty. The action then uses the WordPress account linked to the contact.
Role Yes The role to take away — pick from your site's registered roles.

Step 5: Set the steps Live and save

Each trigger and action has its own Live / Off / Draft switch. A new automation starts as a Draft and does nothing until its steps are Live.

  1. Set the trigger and every action to Live.
  2. Click Save.

Set the automation live

Step 6: Test it

Remove the tag from a contact that belongs to a test WordPress user. Check the user's Role in Users → All Users, or open Zapify → Logs.

Conclusion

With the A tag is removed from a contact trigger and the free Remove a role from a user action, a Groundhogg tag controls access in both directions. Add an email to tell the person in the same automation if you want to.

FAQs

Is this free in Zapify?

The Remove a role from a user action is free, but the Groundhogg trigger is part of the Groundhogg PRO integration and needs an active Zapify PRO licence.

What if the user does not have that role?

The run is recorded as skipped with a message saying so, and nothing changes.

Why did the action fail with "Refusing to remove the only role"?

Zapify will not take away a user's last role, because they would be left with no access at all. Give the user another role first — for example, keep the default Subscriber role alongside the membership role.

Why was the run skipped?

The contact has no linked WordPress account.

Does Zapify's own tag action start this automation again?

No, not by default. Zapify ignores events caused by its own actions, so an automation that adds a tag does not trigger a tag automation in the same request. This is what stops an automation looping back on itself. Tags added by Groundhogg's own funnels, by you, or by another plugin do start it.

Do I need to write any code?

No. Everything is configured visually.

Was this page helpful?