WebTrickz
TRENDING
  • How to Turn Off and Restart iPhone 15
No Result
View All Result
  • Reviews
  • Editorials
  • Social Media
    • Facebook
    • Twitter
    • YouTube
    • Messenger
    • Instagram
    • Snapchat
    • WhatsApp
    • TikTok
  • Apps
  • How To’s
  • Apple
  • iPhone
  • Google
  • Android
  • Mac
  • Security
  • About Us
    • About Us
    • Contact Us
    • Privacy Policy
  • Reviews
  • Editorials
  • Social Media
    • Facebook
    • Twitter
    • YouTube
    • Messenger
    • Instagram
    • Snapchat
    • WhatsApp
    • TikTok
  • Apps
  • How To’s
  • Apple
  • iPhone
  • Google
  • Android
  • Mac
  • Security
  • About Us
    • About Us
    • Contact Us
    • Privacy Policy
No Result
View All Result
WebTrickz
No Result
View All Result
Home Blogging

How to Extract Commentators’ Email Addresses with IP & Name from a Post in WordPress

Mayur Agarwal by Mayur Agarwal
March 11, 2024
in Blogging, How To's

If you’re a blog administrator who frequently organizes giveaways and contests, you’ll find this article really helpful. Making a comment by participants is necessary for most of the giveaways, and it becomes really difficult for site admins to randomly draw the winners if the comments are in large numbers.

We’ve discovered an exclusive way that will allow you to extract the email addresses, IP addresses, and names of all commentators from a specific post in WordPress.

Follow the step-by-step tutorial below carefully to extract the email address:

  1. Log in to cPanel (of your blog host).
  2. Go to phpMyAdmin under the Databases section.
  3. Select your blog database from the left panel, which may be marked as _wrdp1. select your database
  4. Click on wp_comments from the table on the left-hand side. wp_comments
  5. Now click on the “Search” tab.
  6. Open Options (in blue), select comment_author, comment_author_email, and comment_author_ip in the fields box. Tick mark ‘DISTINCT’ to remove exactly similar entries (those with the same name, email, and IP address). set parameters in search
  7. Input comment_post_id = xxxx under “Add search conditions (body of the ‘where’ clause):” Replace xxxx with the post ID.

    To find the Post ID of a post, log in to your blog’s WordPress dashboard. Open ‘Posts’ and point your mouse over the preferred post. You’ll then see a link in the status bar of the browser. Just note the number next to post=xxx (For example: Here it is 7260) as shown below: find post ID in wordpress

  8. Set the Number of rows per page to 1000.
  9. Display order Ascending.
  10. Click the ‘GO’ button. All queries will be sorted now.
  11. Click the Export button, select ‘CSV for MS Excel’ and tick mark ‘Save as file’. Click GO. choose export format

An MS Excel file will now be produced containing all the commentators’ names, IPs, and email addresses from a certain post. You can then find duplicate email and IP addresses and sort the invalid ones using Excel. Then you can copy all the email addresses and use Random.org to draw the giveaway winners.

This guide may seem difficult at first, but you’ll find it really easy once you get used to it. This post is especially for bloggers who conduct big giveaways on their blogs.

Do share this tutorial if you find it useful.

Update (Easy Method)

Sandip of BlogsDNA has provided us with a source code that eliminates 6 steps and makes it really easy to do this task. 🙂 Check below how to do it:

Go to phpMyAdmin and select your blog database. Now click on the “SQL” tab. Input the below SQL query there and click the ‘Go’ button. You’ll now come straight to Step 11.

SELECT DISTINCT comment_author, comment_author_email, comment_author_IP
FROM (
SELECT DISTINCT comment_author, comment_author_email, comment_author_IP
FROM wp_comments
WHERE `comment_post_ID` = ‘xxxx’
) AS WEBTRICKZ

Remember to replace XXXX with your Post ID.

MORE TIPS:

  • Change Image URLs from HTTP to HTTPS in WordPress
  • How to Switch to Classic Editor in WordPress
Tags: GiveawayTipsTutorialsWordPress
ShareTweetSend
Previous Post

How to Insert SIM card in iPad 3G

Next Post

How to Block specific websites on computer with Kaspersky

Mayur Agarwal

Mayur Agarwal

Mayur Agarwal, the founder and editor of WebTrickz, is a tech enthusiast with a Bachelor's degree in Computer Applications and over a decade of writing experience. His passion for technology and gadgets inspires him to create insightful How To's and troubleshooting guides.

Next Post

How to Block specific websites on computer with Kaspersky

Comments 10

  1. Rohit Langde says:
    15 years ago

    That’s good for someone geeky and used to phpmyadmin interface. As far as I remember, I used Contact Commentators plugin by Ajith Prasad Edassery http://wordpress.org/extend/plugins/contact-commenters/ which does the same thing easy way.

    Reply
    • Avinash says:
      15 years ago

      That looks great but too technical for a simple guy. I use a much simpler method to extract email addresses from comments whenever I hold a contest. Even IP address and name is possible with that.

      But still, phpmyadmin method good for anyone who is comfortable with using phpmyadmin. Good post. 🙂

      Reply
      • Mayur says:
        15 years ago

        As I said, this process looks difficult but is really simple to use. BTW.. what simpler method do you use, any plugin?

        Reply
        • Avinash says:
          15 years ago

          Its not a plugin, just a combination of notepad plus MS excel.

          Reply
  2. Raju says:
    15 years ago

    This is very useful and helpful, especially when there are hundreds of entries, wish you had written this last year 😀

    Reply
    • Mayur says:
      15 years ago

      Thanks Raju for appreciating it. Yes, it is very handy for big giveaways where there are numerous comments. 😀

      Reply
  3. Sandip says:
    15 years ago

    Thanks Mayur,

    lol Ok so it was good laugh for me to teas Mayur with “BLOGSDNA” watermark thingy but well You can replace BLOGSDNA from above query with any thing you like but it should read some thing like “AS XYZ”. 🙂

    Reply
    • Mayur says:
      15 years ago

      Haha… so can I replace BLOGSDNA with WEBTRICKZ with your consent. 😀

      Reply
      • Sandip says:
        15 years ago

        Yeah go ahead. 🙂

        Reply
  4. Pingback: Getting Comment Info from the WordPress Database | Digging into WordPress

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Latest Stories

ios 18

iOS 18: How to Add Screen Record to Control Center on iPhone

March 30, 2025
ios photos logo

iOS 18: How to Clear Recently Viewed Photos on iPhone

December 27, 2024
ios photos logo

How to Find Your Favorite Photos in iOS 18 on iPhone

December 30, 2024
ios 18

How to Reset Control Center to Default in iOS 18.1 on iPhone

April 2, 2025
iphone 16 pro max always-on display

How to Turn Off Always-On Display on iPhone 16 Pro & 16 Pro Max

November 11, 2024
ios 18

How to Find Recently Deleted Photos in iOS 18 on iPhone

December 30, 2024
apple iphone 16 pro

How to Close Apps on iPhone 16, 16 Pro, and 16 Pro Max

October 22, 2024

Trending Stories

  • Apple iphone 16

    How to Turn Off and Restart iPhone 16, 16 Pro, and 16 Pro Max

  • How to Put Your iPhone 16 on Vibrate or Silent Mode

  • How to Turn Off & Restart iPhone 15, 15 Pro, and 15 Pro Max

  • How to Turn Off Most Relevant Comments on Facebook

  • 4 Ways to Remove the Floating Home Button on iPhone

  • About Us
  • Contact Us
  • Privacy Policy
  • Advertise

© 2025 WebTrickz. All Rights Reserved.

No Result
View All Result
  • Reviews
  • Apps
  • How To’s
  • Android
  • Google
  • iPhone
  • Mac
  • About Us
  • Contact Us
  • Privacy Policy

© 2025 WebTrickz. All Rights Reserved.