Duplicate MySQL rows with slight changes
For use with AWS S3 Wordpress pluign
Copy this code and paste it in your HTML
INSERT INTO wp_postmeta
(post_id
, meta_key
, meta_value
) SELECT post_id
, 'amazonS3_info' as meta_key
, CONCAT('a:2:{s:6:"bucket";s:7:"bucketname";s:3:"key";s:', CHAR_LENGTH(meta_value
) + 19,':"wp-content/uploads/', meta_value
, '";}') FROM wp_postmeta
WHERE meta_key
= '_wp_attached_file'
Report this snippet
Comments
Subscribe to comments