How to get meta key list efficiently?

As mentioned in the comments you can query the postmeta table directly: public function get_metadata_keys(){ global $wpdb; $meta_query = $wpdb->get_results( ” SELECT DISTINCT meta_key FROM {$wpdb->postmeta} ” , ARRAY_A ); $meta_keys = wp_list_pluck( $meta_query, ‘meta_key’ ); return $meta_keys; } This will return the list of all meta_keys associated to any post.

How to update a database entry with a wordpress plugin?

$newaddress = array( ‘address’ => ‘$newaddress’ ); // Incorrect Is not the same as: $newaddress = array( ‘address’ => $newaddress ); // Correct And you have a missing ; at the end of: $myrows = $wpdb->get_results( “SELECT address FROM wp_mediopay WHERE id = 1” ) And before the above line you must also have: global … Read more