Support » Themes and Templates » Storing User Info

  • How do you make it so in when people post comments, their name, email address, and website is stored for them so they don’t have to type it in again?

Viewing 15 replies - 1 through 15 (of 16 total)
  • Two possibilities:

    1. If they have cookies turned on in their browser, you shouldn’t need to do anything for them. WordPress sets these in its cookie file the first time they comment on your site.

    2. Get them to register and login before commenting, as this info can be passed to the comment form.

    Sorry, should’ve explained it better.
    I meant that it stores the information for the people, and it doesn’t displays “Welcome Kafkaesqui” and beside it a “Change” link for changing it and just message field/box.

    Do you know what I mean?


    I don’t know what you meant. I thought Kafkaesqui’s anwer already covered it.

    “[I]t doesn’t displays “Welcome Kafkaesqui” and beside it a “Change” link for changing it and just message field/box.”

    You can duplicate the functionality found in the default theme’s comments.php that would let you set up something like this for users who are logged in; there’s some testing that occurs on $user_ID in that template. Beyond this I’m not sure about what you’re looking for.

    Sorry for the late reply. I mean something like this.

    Any ideas?


    What you show on the image is not a WP thing. It seems to be some kind of “chatting” plugin or whatever added.
    First, you should have clarify that in your original post; secondly ask about it at its author’s site.

    Moshu, it’s from K2. I didn’t ask Michael about this since he said that all WP related questions should go here?

    I’ll see if I should mail him.


    K2 is not WP. I think… but I am often wrong ๐Ÿ™‚

    Can you use ScriptyGoddess Show/Hide plugin for this?

    <?php if ( $user_ID ) : ?>

    Logged in as <a href="<?php echo get_option('siteurl'); ?>/wp-admin/profile.php"><?php echo $user_identity; ?></a>. <a href="<?php echo get_option('siteurl'); ?>/wp-login.php?action=logout" title="<?php _e('Log out of this account') ?>">Logout &raquo;</a>

    That displays

    “Logged in as TedFox. Logout ร‚ยป”

    I’m sure u can change the specifics as needed easily.
    No need for plugins, but only works if person commenting is registered

    Tedfox, I know that. But I needed something like this. So when people come the next time to post comments, it doesn’t show them the name, email, website fields since it’s already stored.

    Thanks for the reply though. ๐Ÿ™‚

    bk, that’s pretty much what tedfox just showed.

    As I noted above, the default theme’s comments.php does what you’re asking. Just copy the comment form element from that and modify to suit your needs (such as changing the text to say Welcome back …).

    But won’t the users have to register, so it says “Logout Name”?

    Yes, they would. It would have helped if you had specified this was not what you were after…

    The above is a mod of the default theme’s comments.php template. It does not include the “change” link feature. For that you’d have to set up a php script, or some javascript, that would clear/reset the comment author cookies.

Viewing 15 replies - 1 through 15 (of 16 total)
  • The topic ‘Storing User Info’ is closed to new replies.