Skip to main content
2 of 2
copyedit for readability
Nathan Johnson
  • 6.5k
  • 6
  • 30
  • 49

How to stop WordPress from updating the post meta

I have tried using many hooks to achieve this. I don't want one of my post meta to be updated when we update post.

I tried doing something like :

add_filter( 'update_post_metadata', 'wpse_163859', 10, 5 );
function wpse_163859( $check, $object_id, $meta_key, $meta_value, $prev_value )
{
    return false;
}

I tried looking at meta.php in wp-includes, tried whole day with lots of code, appreciate any help.

Den Pat
  • 189
  • 7