Custom Field 101

I would not use custom fields or shortcodes for this functionality, I would look at filters. the_content filter and the loop_end action (just make sure that your theme uses while ( have_posts() ) in single post pages) comes to immediate mind here. These are two options which requires no modification of any of your files … Read more

How to mass update custom fields for more than 20k posts

I just tested this and it works. <?php function toCall(){ global $wpdb; $togos = $wpdb->get_results(“SELECT * FROM $wpdb->postmeta WHERE meta_key=’_nelioefi_url'”); return $togos; } foreach (toCall() as $go) { global $wpdb; $wpdb->update( $wpdb->postmeta, array( ‘meta_key’ => ‘external_thumbnail’, // string // ‘column2’ => ‘value2’ // integer (number) ), array( ‘meta_id’ => $go->meta_id ) ); }; ?> You … Read more