WordPress MySQL: Cleanup old revisions old posts old entrys

Problem: If you use wordpress and edit often your posts a high count of old revisions are backuped inside the mysql database:

Login mysql

$mysql -u root -p [Enter root password]

at mysql command line select wordpress your database
mysql>use wordpressdb; [Enter]
System echo=Database changed..

delete old backups of posts
mysql>DELETE FROM wp_posts WHERE post_type = "revision"; [Enter]
System echo=..Entry affected time..

logout database and revisit pages, if you have made a database backup with mysqldump before and after cleanup you see how much size the database lost (du -h wordpress.sql)
often 80% of the size.

Impressum Datenschutz-DSGVO-GDPR

Last Update 08.10.2023 www.linuxonlinehelp.eu - Nonprofit Linux PC & Server Support since 2004 Tags: Linux Online Help, Linuxonlinehelp, Linux Support, Linux Hilfe