admin管理员组文章数量:1125611
I love the comment by s_ha_dum : and havent tried it yet, but Im wondering just how 'clever' this actually is?
Does the unused postmeta affect the speed of my database? Does removing the postmeta in this way affect anything else I would later regret? Is there any practical way to test this on a database with 1000's of posts and multiples of this in postmeta rows?
I love the comment by s_ha_dum : http://wordpress.org/support/topic/sql-query-to-delete-postmeta and havent tried it yet, but Im wondering just how 'clever' this actually is?
Does the unused postmeta affect the speed of my database? Does removing the postmeta in this way affect anything else I would later regret? Is there any practical way to test this on a database with 1000's of posts and multiples of this in postmeta rows?
Share Improve this question asked Jun 28, 2012 at 11:46 Laurence TuckLaurence Tuck 9402 gold badges10 silver badges21 bronze badges3 Answers
Reset to default 3Does the unused postmeta affect the speed of my database? Anything in your database affects the speed of your database. The question is how much of a slowdown, and if the amount of data is significant enough. Unless your having a huge amount of metadata it will not affect the speed of your database very much.
Does removing the postmeta in this way affect anything else I would later regret? Anything that uses your postmeta data will be screaming for help. Assuming your only using your postmeta to display extra information, it shouldn't be a problem. I haven't tried the code which is mentioned in your link, but the author him/her self doesn't guarantee if it works.
Is there any practical way to test this on a database with 1000's of posts and multiples of this in postmeta rows? Like the orginal poster mentioned "Test it on a development server with dummy data." If it works on a small set of data it will also work on a bigger set of data (but it will take longer).
If your looking for a way to delete postmeta for only certain post you can take a look at delete_post_meta. You can also try plugins like WP-CleanFix, WP-Optimize, and WP-CleanUp.. to optimize and clean up your database.
If you want to delete All value with Key then you should try - Edit Custom Field plugin. I used it and it's impressive. Make sure to backup your data before deleting the key.
For example if You want to delete yourcustomkey which you want to delete from database then just select the key and click on delete, after running this query the whole data of yourcustomkey with it's value will be deleted.
SELECT * FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL; DELETE pm FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL; ref: https://www.inmotionhosting.com/support/edu/wordpress/cleaning-up-old-post-meta-data-in-wordpress/
本文标签: post metadelete unused postmeta
版权声明:本文标题:post meta - delete unused postmeta 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736668652a1946797.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论