So I'm using a wordpress plugin for a while to add a "Sources" custom field into the end of each post. The thing is this plugin isn't updated for 4 years and I want to get rid of it. But I can't afford to lose the saved sources for each post. I could manually edit these posts one by one, but after looking at the database with the query below I found that theres over 19k posts using this sources plugin.
SELECT *
FROM `wp_postmeta`
WHERE `meta_key` = 'sa_source'
AND `meta_value` <> ''
The sources are stored in wp_postmeta table, meta_value column. As I'm not great at SQL, I'm here looking for some help. I need to insert the content from:
wp_postmetatable,meta_valuecolumn. Wheremeta_valueis not empty
into the end of:
wp_poststable,post_contentcolumn. Where thepost_idfromwp_postmetais the same asIDfromwp_posts