To disable comments on posts older than date X in WordPress you can use the snippet below.
Sample mySQL
UPDATE wp_posts SET comment_status = 'closed' WHERE post_date < '2013-01-01' AND post_status = 'publish'
To disable comments on posts older than date X in WordPress you can use the snippet below.
UPDATE wp_posts SET comment_status = 'closed' WHERE post_date < '2013-01-01' AND post_status = 'publish'
To delete all unapproved comments in WordPress you can use the following snippet.
DELETE FROM wp_comments WHERE comment_approved = 0
To remove any post that is older than X days in WordPress you can use the query below.
DELETE FROM wp_posts WHERE post_type = 'post' AND DATEDIFF(NOW(), post_date) > X
To disable or enable Trackbacks and Pingbacks in WordPress you can use the following mysql queries.
enable
UPDATE wp_posts SET ping_status = 'open';
disable
UPDATE wp_posts SET ping_status = 'closed';
To identify unused tags in WordPress you can use the following snippet.
SELECT * From wp_terms terms INNER JOIN wp_term_taxonomy tax ON terms.term_id=tax.term_id WHERE tax.taxonomy='post_tag' AND tax.count=0;
To change user password in WordPress using MySql you can use the following query.
UPDATE wp_users SET user_pass = MD5('NewPassword') WHERE user_login = 'UserName';
To delete all pingbacks in WordPress you can use the mysql query below.
DELETE FROM wp_comments WHERE comment_type = 'pingback';