It's unclear what the postmeta actually does so it could effect your website in any number of ways.
At best it will just clear the field / option and the user will need to re-enter it for that specific page.
At worst it could change a pages layout or orphan a media file in your media library ( assuming the field holds an attachment ID ). Other than that I cannot see a reason why deleting a row in the postmeta table would be extremely harmful.
Whenever a post is deleted WordPress does delete all the postmeta assigned to that post ID. The wp_delete_post()
function says...
When the post and page [gets deleted], everything that is tied to it is deleted also. This includes comments, post meta fields, and relationships between the post and taxonomy terms.
The delete_post_meta()
function can be ran almost anywhere core has been loaded. You could put it inside an init
or save_post
hook and run it once then remove the function call. For example:
function delete_somemeta() {
// This will run every single time a page is loaded.
delete_post_meta( $POST_ID, 'META_KEY_NAME' );
}
You could add this to your functions.php
, reload the front-end of your website, then remove it and it will effectively do the same thing as removing the row from the database.
This type of function is most commonly seen as conditional removal of postmeta in save_post
hook though when saving metabox data.