Created
May 14, 2017 16:15
-
-
Save twentyfortysix/47b351cd06d816258c641abe45dfffe0 to your computer and use it in GitHub Desktop.
WP - bulk update post meta
This file contains hidden or 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 | |
function _run_once(){ | |
$posts = get_posts(array( | |
'numberposts' => -1, | |
'post_type' => 'place' | |
) | |
); | |
foreach($posts as $p) : | |
// $meta = get_post_meta($p->ID, 'advertiser_type',true); | |
//remove the meta key | |
update_post_meta( $p->ID, 'advertiser_type', 0, '' ); | |
endforeach; | |
} | |
// _run_once(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment