WordPress

fight with spam comments

delete spam comments

DELETE FROM wp_comments WHERE comment_approved = 0;

list junk entries:

SELECT * FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments)

Delete junk entries:

DELETE FROM wp_commentmeta WHERE comment_id NOT IN (SELECT comment_id FROM wp_comments)

Disable comments for old blog entires:

UPDATE wp_posts SET comment_status = 'closed' WHERE post_date < '2019-01-01' AND post_status = 'publish';

Disable comments in whole Wordpress: WP-Admin: UstawieniaDyskusja: Zezwól na komentowanie nowych artykułów

UPDATE wp_options SET option_value = 'closed' WHERE option_name = 'default_comment_status'; 

install plugin