WordPress Podpress Plugin – Update File Urls

Use at your own discretion! In short, if you ever wanted to move your media files in wordpress to another domain or something, you can use this code via functions.php to do the job.

prefix."postmeta as pod WHERE pod.meta_key = '_podPressMedia'";
$podpressmetadata = $wpdb->get_results($query_string, ARRAY_A);
if ( TRUE === is_array($podpressmetadata) AND FALSE === empty($podpressmetadata) ) {
for ($i=0; $i < count($podpressmetadata); $i++) {
$data_ar = unserialize($podpressmetadata[$i]['meta_value']);
if ( TRUE === is_array($data_ar) AND FALSE === empty($data_ar) ) {
for ($j=0; $j update( $wpdb->prefix.'postmeta', array('meta_value' => $podpressmetadata[$i]['meta_value']), array('meta_id' => $podpressmetadata[$i]['meta_id']), array('%s'), array('%d') );
register_activation_hook( __FILE__, array('podPress_Location_URL_update', 'update_urls') );


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s