Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save bhwebworks/80c3d6ce06bba53bfa0ef700c2e01bb4 to your computer and use it in GitHub Desktop.

Select an option

Save bhwebworks/80c3d6ce06bba53bfa0ef700c2e01bb4 to your computer and use it in GitHub Desktop.
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]
@meemal

meemal commented May 18, 2026

Copy link
Copy Markdown

Thank you for sharing this! Appreciated!

@bhwebworks

Copy link
Copy Markdown
Author

Thank you for sharing this! Appreciated!

You are welcome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment