You Are Here...

Get custom fields value from all posts WordPress

TThemes July 17, 2023 No Comments

Get custom fields value from all posts WordPress custom question using get_results and prepare method.

global $wpdb;
$result = $wpdb->get_results($wpdb->prepare(
"SELECT meta_value FROM wp_postmeta WHERE meta_key = %s", 'post_meta'
), ARRAY_A);

Tags

Leave a Reply