I have some post meta entries which I like to delete from the database. The delete_post_meta() function seems the way to go:
delete_post_meta( int $post_id, string $meta_key, mixed $meta_value = '' )
The problem: I have many entries with the same meta_key, so I'd like to specify the rows to be deleted by meta_value. But, the meta_value is serialized data. So how do I use delete_post_meta()
to delete the post_meta by a specific value of the specialized data?
For example, the serialized data:
a:6:{s:2:"id";s:1:"1";s:4:"name";s:3:"PM1";s:5:"email";s:19:"[email protected]";s:3:"url";s:24:"https://example.nl/";s:4:"paid";s:1:"0";s:4:"city";s:9:"amsterdam";}
How do I delete by serialized ID value?