Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.
Microsoft is blocking us again (TY IP Reputation!) so just use oauth login instead. :)

Paste

Pasted as PHP by metakeys ( 6 years ago )
// Change or add your own arguments as needed 
$args = array(
    'post_type'   => 'post', 
    'numberposts' => -1,
    'offset'      => 0
);
$my_posts = get_posts( $args );
if ( $my_posts ) {
    foreach ( $my_posts as $my_post ) {
        $meta = get_post_meta( $my_post->ID, '_name_of_your_custom_field', true );
        if ( ! empty( $meta ) )
            wp_set_post_terms( $my_post->ID, $meta, '_name_of_your_taxonomy');
    }
}

 

Revise this Paste

Your Name: Code Language: