H
H
harindmitrii2018-07-27 09:36:20
SQL
harindmitrii, 2018-07-27 09:36:20

How to remove duplicate posts in Wordpress using sql command?

Hello. Site on WP, more than 700,000 posts. You need to remove duplicates. I tried in phpmyadmin to enter the request:

DELETE t1 FROM `wp_posts` AS t1,`wp_posts` AS t2
WHERE t1.`post_title`=t2.`post_title` AND t1.ID>t2.ID

At first, a 504 gateway time-out error occurred. Changed parameters in nginx.conf:
was:
proxy_connect_timeout 600;
proxy_send_timeout 600;
proxy_read_timeout 600;
send_timeout 600;
changed:
proxy_connect_timeout 8400;
proxy_send_timeout 8400;
proxy_read_timeout 8400;
send_timeout 8400;
After that, the sql query was processed for a long time, as a result, when accessing all server sites, the error "Error Establishing Database Connection" was displayed.
Tell me what server config settings can be done to complete the sql query. Is it possible to change the sql query so that duplicates are deleted in the specified category (category) in order to reduce the volume of the operation by breaking it into several parts?
I tried a bunch of plugins to remove duplicate posts. Not one can do it.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
O
Orkhan Hasanli, 2018-07-27
@azerphoenix

Maybe you should install the plugin https://ru.wordpress.org/plugins/delete-duplicate-...
It can run the deletion of duplicates hourly by cron...

E
eremenkoEvgeniy, 2021-03-08
@eremenkoEvgeniy

Hello, the same question
. Did you manage to somehow calculate duplicates through sql?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question