Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

avoid post_meta bloat by not saving blank meta entries #56

Open
columbian-chris opened this issue Jun 8, 2023 · 0 comments
Open

avoid post_meta bloat by not saving blank meta entries #56

columbian-chris opened this issue Jun 8, 2023 · 0 comments

Comments

@columbian-chris
Copy link

I noticed that my post_meta table has hundreds of thousands of blank post_meta table entries for the wps_subtitle meta key (it is, mind you, a large site), which since a call to get_post_meta() returns an empty string if the field is not set, it is the same as having an empty record set, therefore these blank entries prove to be an unnecessary bloat to the post_meta table.

This bloat can be easily solved by changing the calls to update_post_meta to only update if the subtitle is not blank, otherwise use delete_post_meta instead.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant