Created
April 14, 2015 18:48
-
-
Save greenrobot/8feae5738d37231988b2 to your computer and use it in GitHub Desktop.
WordPress DB script to update references to uploaded files (pictures)
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
SELECT meta_value, SUBSTRING(meta_value FROM 9) meta_value FROM `wp_postmeta` where meta_key = '_wp_attached_file' AND meta_value like '2014/%' | |
# UPDATE wp_postmeta SET meta_value = SUBSTRING(meta_value FROM 9) where meta_key = '_wp_attached_file' AND meta_value like '2014/%' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment