function import() { $count = 0; global $wpdb; $values = $wpdb->get_results("SELECT * FROM {$wpdb->postmeta} WHERE meta_key='head-meta'"); if ($values) { foreach ($values as $value) { MetaData::add_raw($value->post_id, $value->meta_value); } $count += count($values); } return $count; }