2
I have a database with news posted since 2015. I decided to delete the posts, leaving only the last 30 days. With this, I expected the database to reduce in size and this did not happen. Look how I did:
In Phpmyadmin, I downloaded the table, went to the tab to type SQL commands and deleted the records with the command:
DELETE FROM `wp_posts`
WHERE `post_type` = 'post'
AND DATEDIFF(NOW(), `post_date`) > 30
Then I optimized the entire database and lo and behold the database is almost the same size.
Did the answer solve your question? Do you think you can accept it? See [tour] if you don’t know how you do it. This would help a lot to indicate that the solution was useful to you. You can also vote on any question or answer you find useful on the entire site.
– Maniero