Changing WordPress Commenter Information

I came across a situation where I had to go through my WordPress database to update the URL information for one of my frequent commenters in light of his new domain name. Rather than modifying each of his comments one by one, I sought a single database query that would reflect the update. All I had to do was go into CPanel, open up phpMyAdmin, select my WordPress database, select the “Query” tab, and then input the following query:

UPDATE `WP-database-name`.`wp_comments` SET `comment_author_url` = 'new-URL' WHERE `wp_comments`.`comment_author` ="commentator-name"

For example, let’s say that user “Guest” has been posting comments for months and finally got a domain name of his own, https://guest.com. If I wanted to append this URL to all his previous comments, I would run the following query on this site.

UPDATE `MY-DATABASE-NAME`.`wp_comments` SET `comment_author_url` = 'https://guest.com' WHERE `wp_comments`.`comment_author` ="Guest"

In essence, I’m telling phpMyAdmin to “update” my WordPress comments table by setting the new URL, https://guest.com, for every entry where the author was named “Guest.”

This process can be extended to other criteria as well. For example, let’s say that a commentator has been using multiple “names” but the exact same e-mail address whenever they posted on your site. You can go through the database, select all instances of that e-mail address, and set the desired user name.

This sure simplifies life. 🙂

Related Articles

5 COMMENTS

  1. Appreciate it buddy! Wish I had your 4+ years of experience with WordPress and of tweaking the CSS code. Lol. I will definitely mold the site into into something much better than what it is now, just need time. 😉

    • You, of course. 🙂 Your site’s credibility will improve if sites which already have credibility link to it. By leaving a URL with your comment, search engines “see” it as a link from this site to your main site. Since you left so many comments in the past, I thought I should extend you the courtesy of going ahead and updating all of them to reflect your new site.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Try EchoTools - my free, iOS ultrasonography reference application!

Latest Articles