Last active
August 29, 2015 14:06
-
-
Save mohamedrez/33eff325598dc7626d25 to your computer and use it in GitHub Desktop.
WP: Bulk update custom field using a sql query
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$ids = $wpdb->get_results("SELECT id FROM wp_4_posts WHERE post_type = 'post' LIMIT 0 , 300"); | |
foreach($ids as $id){ | |
update_post_meta($id->id, 'post_country', 'ksa'); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment