Skip to content

Instantly share code, notes, and snippets.

View meemal's full-sized avatar

Naomi Spirit meemal

View GitHub Profile
@bhwebworks
bhwebworks / block-spam-registrations-with-htaccess-unless-referred-from-specific-page
Last active May 18, 2026 16:36
Add this to .htaccess to block access to the WordPress default registration form unless referred from a specific page
#Block spam registrations (wp-login.php?action=register)
# Why? Server overloads and bounced emails
RewriteEngine On
#RewriteCond %{HTTP_REFERER} !^https://settigang.com/portal-access/?ld_register_id=580.*$ [NC]
RewriteCond %{HTTP_REFERER} !^https://settigang.com/portal-access/.*$ [NC]
RewriteCond %{THE_REQUEST} ^.*(wp-login.php\?action=register).* [NC]
RewriteRule ^(.*)$ - [F,L]