You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
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 toget_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 usedelete_post_meta
instead.The text was updated successfully, but these errors were encountered: