Anyone know sql query or wordpress plugin which may help me to remove duplicate comments.
While I was importing posts, comments into wordpress, i got some timeouts, and repeated process, so some of comments posted twice.
Anyone know sql query or wordpress plugin which may help me to remove duplicate comments.
While I was importing posts, comments into wordpress, i got some timeouts, and repeated process, so some of comments posted twice.
You must be logged in to post a comment.
Taking a look at some of the images of WordPress’ schema then you should be able to identify the records you want to delete with a query such as
You should run the query above and make sure you it is returning the correct records (the ones that will be deleted). Once you are satisfied the query is working then simply change it from a
SELECT
to aDELETE
Wow, this worked like a charm, a more aggressive form I used eventually to eliminate all duplicate comments regardless of author or post ID will be :
This will delete useless short comments that work like a template like: “Thanks”, “Great”….
I had this problem recently and ended up writing this little script to handle it. What’s nice about this is it will also leave you with correct comment counts per post. If you only delete the duplicate comments without changing this the count will be off.
I tried all the options above. Unfortunately, grimmdude’s didn’t work. The solution provided by TI deleted both comments if any were duplicated. I wanted to keep one of the duplicates. With a little help from a friend, this script did the trick.
For anyone that needs the direction, this should be an SQL query run on the DB.