Removing old_slug and old_date from WordPress Database

Firstly it’s great to clean up your database, and doing this may make some queries faster. Bear in mind that the size of the data in this case is small and these postmeta keys may not be often used so there is little value in removing them, especially if you find you need them late:

  • _wp_old_slug: This has the practical use of WordPress being able to redirect old slug URL’s to new ones. It could be very useful. Removing these may improve site speed for some queries if you can remove say 1,000’s. Maybe some broken exernal links if you remove them, but you could keep these links working by manually adding redirects to e.g. .htaccess
  • _wp_old_date: I did not find all of the things this is used for, but it seems to be mostly used for e.g. _find_post_by_old_date(), however there are quite possibly other uses I didn’t find. Again, you need to remove a lot of these (10,000+) to make any different to speed and the value of keeping these around could be high if you need them in future.

Your database may have data that’s specific to you and your plugins, so a great way to keep your database working nicely would be to install the Query Monitor plugin and see if you have any long running queries, or plugins that run lots of queries or slow queries, and then figure out how to make these go faster.