0

I've been trying to convert the anonymous comment form to register users. However not only me but other people asked and there are no working answers on stackexchange. So I give up. Now I just want to change the anonymous comment form into a user registration form if the user isn't already logged in.

Besides the html to create the form, which shouldn't be hard to do, just need a couple form fields; what other things do I need to do to make it so that when a user wants to comment there is a registration form with a couple fields that creates a new user and queues the comment for moderation?

If I can't do one or the other, eventually I will just give up and disable anonymous comments altogether and force users to go register before commenting. Unfortunately that will result in a drastic decrease in comments, but if it's the only way if no one on this site knows enough to help, then I'll have to live with less comments and engagement.

I wanted to make a better user experience, so hopefully you can help me do so by letting users register right on the comment form without forcing them to visit another page.

0

On the comment form page if they are not logged in send a 301 redirect to the registration page. (wp-login.php) Pass along a GET variable with the current page and use it in a function like this: Registration Redirect Function. Wrap it in an if statement checking for the GET variable. Then redirect to that url in the variable.

So when they go to comment they are taken straight to the registration form, then once they complete the registration they are taken back to the comment field.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.