As you know that WordPress depend upon Database and Database eat rams of server so if you have a shared hosing and your Database is going to increase then you can be banned from hosting even if you paid for it so you don’t have to take chance and keep it low after cleaning empty and useless tables, columns, rows and entries.
As you know, wp_postmeta table hold data related to wp_posts. Example – All In One SEO Pack and Youst SEO Plugin will create entries in wp_postmeta table if you define the keyword or description and other SEO related data for each blog post. WordPress run both wp_posts and wp_postmeta table each time when people visit your blog post to show all the data on page.
So before going to clean it, you have to know that How many data type of your wp_postmeta table have? So for this you have to collect all of these in group so there you can know what you have and what is useless. For getting all in groups, run the below query in your Hosting -> PHPMyAdmin -> WordPress Database -> wp_postmeta -> SQL tab as shown in below screenshoot.
SELECT meta_key, COUNT(meta_key) FROM wp_postmeta GROUP BY meta_key;
Now after this you will get your all thousands of rows in 10-15 rows where all will be sum up. Now see and thing what is useless. We always says to make a backup of database if you are doing anything to WordPress database. Now there’s high number of count for both _edit_lock and _edit_last meta_key and these are useless records so feel free to delete then with running the below quires as you run the above one. No error detected when create, edit and publish blog post after the removal of _edit_lock and _edit_last meta_key.
DELETE FROM wp_postmeta WHERE meta_key = '_edit_last'; DELETE FROM wp_postmeta WHERE meta_key = '_edit_lock';
Now if you want to delete many others then run the below query by changing the Meta-Key-Name…
DELETE FROM wp_postmeta WHERE meta_key = 'Meta-Key-Name';
This is what we have and shared in easy steps for newbies so that they can easily know how it works. Stay with us because we are going to share a whole guide step by step about WordPress and make it easy for you. If you liked it then share it and be with us to get next tutorial. If you have any problem then feel free to ask us. We will help you with what we can or have.