I stumbled across this as a possible fix for slow loading and resource hogging websites that have LOTS of content, especially posts numbered in the thousands. Something like the Google spider could use up your sites bandwidth and resources pretty quick if it has to try index thousands of old posts. Most sites might not need to keep older posts live because they will have become irrelevant and outdated over time.
Login to your hosting control panel then click on the phpMyAdmin icon. Click the name of your sites database then “Export” on the top bar just to make a database backup first in case anything goes wrong. Choose “gzip backup” in advanced settings if your database is huge. Next click the “SQL” title on the top bar and paste the following in the box then click Go bottom right:
DELETE FROM `wp_posts` WHERE `post_type` = 'post' AND DATEDIFF(NOW(), `post_date`) > 180
What the above SQL command does is delete all blog posts in your site’s database with the posts type “Posts” as opposed to Pages and it deletes everything older than 180 days or 6 months. You can adjust this to suit yourself of course.
Once you’ve done this you might consider installing the Auto Prune Posts WordPress plugin to keep things tidy automatically in future.
- Shopify vs WordPress: Which is the best solution for building an online store?
- Speed Up WordPress and Boost Performance: Top WordPress Optimization Tricks
- Search Engine Optimization (SEO) Tips and Tricks for WordPress Site [10 points]
- Why Blogger Should Stop using Tags in their WordPress Blog Post?
- Do bloggers make money blogging? Like, Really?
- How to Optimize Your Blog Posts For SEO in 2019
Thank you for reading this blog and welcome back again! We are happy to see you here. Did you like this post? Kindly share the post using the buttons below. Drop your comments below in the comment box.