How to remove any post that is older than X days in WordPress

To remove any post that is older than X days in WordPress you can use the query below.

Sample mySQL

DELETE FROM wp_posts WHERE post_type = 'post' AND DATEDIFF(NOW(), post_date) > X

Please rate this snippet

How to change default Admin Username in WordPress

Every default WordPress installation will create an account with a default Admin username. This can be a security issue.
To change default Admin Username in WordPress you can use the mySql snippet below.

UPDATE wp_users SET user_login = 'NewUsername' WHERE user_login = 'Admin';

Please rate this snippet