Email confirmation on registration

I had to implement this for a client site and ended up creating my own system.

I hash the email and date created timestamp and store it as a key in usermeta, then i email that key to the user’s email in the form of a link. The link points to a page where I’ve created a rewrite rule and added my own query var so I can make nice site.com/authorize/{key} links.

When they click through the link, I look up the matching user with that key and delete the key so they can now log in. I actually also log them in right there with wp_signon and use wp_redirect to send them to a welcome page.

On my custom login form I check if the key has been deleted for a user before letting them log in.

There may be a plugin to enable this same process, or perhaps some of it can be achieved via hooks where I’ve just rewritten it, I’m not sure, I didn’t explore doing it that way because of additional unique requirements for this particular project.

Leave a Comment