Skip to content

Instantly share code, notes, and snippets.

@matteosavio
Last active October 20, 2022 18:12
Show Gist options
  • Save matteosavio/5c7224f72e78327faa44640c54eae40a to your computer and use it in GitHub Desktop.
Save matteosavio/5c7224f72e78327faa44640c54eae40a to your computer and use it in GitHub Desktop.
Transfering information from audio_file to url_mp3_hoster
DELETE FROM wp_postmeta
WHERE meta_key="url_mp3_hoster";
INSERT INTO wp_postmeta ( post_id, meta_value, meta_key )
SELECT
post_id,
SUBSTRING(meta_value,1,POSITION(".mp3" IN meta_value)+4),
"url_mp3_hoster"
FROM wp_postmeta
WHERE
meta_key="audio_file"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment