Skip to main content

Knowledge > Runbooks > Customer Ops > Remove Church

Remove (Hide) a Church Listing from PewSearch

Hide a church from appearing in the PewSearch directory. This is used for closures, duplicate listings, spam entries, or a church's explicit removal request.

Prerequisites

  • Supabase access
  • Founder approval (this affects a visible public listing)
  • Church UUID or slug

CRITICAL Rules

  • NEVER delete a church row. Set directory_visible = false only. Row deletion would break foreign key constraints, delete history, and is irreversible.
  • Cancel the subscription first if the church has an active premium subscription. Hiding without cancellation leaves the church paying for a listing they can't see.
  • 218K visible churches are counted with directory_visible = true. Hiding does not affect the 261K total row count.

Steps

1. Identify the church

SELECT id, name, slug, email, city, state, directory_visible,
pc.plan, pc.stripe_subscription_id
FROM churches c
LEFT JOIN premium_churches pc ON pc.church_id = c.id
WHERE c.slug = '[church-slug]'
OR c.name ILIKE '%[church-name]%'
LIMIT 3;

Note the id, directory_visible status, and whether there is a premium subscription.

2. Cancel the subscription if active

If stripe_subscription_id is not null and the plan is not 'free':

stripe subscriptions cancel sub_xxxxxxxxxxxx

See cancel-subscription.md for full cancellation steps. Do this BEFORE hiding the listing.

3. Verify you have the correct church UUID

-- Safety check: should return exactly one row
SELECT id, name, city, state FROM churches WHERE id = '[church-uuid]';

4. Set directory_visible = false

UPDATE churches
SET directory_visible = false,
updated_at = now()
WHERE id = '[church-uuid]';

5. Verify the update

SELECT id, name, directory_visible, updated_at
FROM churches
WHERE id = '[church-uuid]';

directory_visible should be false.

6. Verify the listing no longer appears on PewSearch

Wait for ISR cache to expire (up to 1 hour), then:

  • Search for the church by name at https://pewsearch.com/directory — it should not appear
  • Attempt to visit their direct URL https://pewsearch.com/churches/[slug] — it should return 404 or a "not found" page (depending on implementation)

7. Notify the requester

If the church requested removal, confirm by email that their listing has been removed.

Restoring a Hidden Church

To make a church visible again:

UPDATE churches
SET directory_visible = true,
updated_at = now()
WHERE id = '[church-uuid]';

Reasons for Hiding

ReasonNotes
Church closed permanentlySet directory_visible = false
Duplicate listingSet directory_visible = false on the duplicate; keep the canonical (see merge-duplicates.md)
Spam / invalid entrySet directory_visible = false; investigate how it was created
Church removal requestCancel subscription first; then hide
Data quality issueFix the data first; then decide if hiding is needed

See Also