Question

Is it possible to block user registration based on the referring URL? I have an open registration WP site (configured so users can post ads and events) and while I typically don't get a lot of spam registrations (there is a reCaptcha involved), I was listed on a site as an example of the capabilities of the theme I'm using, and it generates a lot of "test" type of traffic. I like the traffic, but I don't like people registering just to post false test posts just to see how the site works, so I'd ultimately like to simply block registration from that referring URL. Thanks!

Was it helpful?

Solution

You can use "register_post" hook that happens just before the user is saved to the database or you can use "register_form" hook and check the referring URL for a match and die();

OTHER TIPS

Along with what Bainternet said, you could also set a session with that url in it, so if they go to your site and then go to another site/page and come back. You would still have that referring url there to check for.

Licensed under: CC-BY-SA with attribution
Not affiliated with wordpress.stackexchange
scroll top