Update post_content in database
I have over 2000 pages in my wordpress site and I want to replace the post content on them with updated information.
The issue I’m having is part of the content is the company name which will be dynamic on each post. I also need to do this by category.
First, I realize I can use phpmyadmin and clear out the contents and the custom field I need to insert into the post content is housed in wp_postmeta.metakey which is ‘Supplier’. I need to insert the wp_postmeta.metavalue for that key into the corresponding post_content in wp_posts.postcontent. Right now, for example, lets say I want to do this for category_id 9. How would I go about clearing out the post content and then putting in new content?
To clarify, I want to clear out the current content and then have something like this:
“No current data for ” put supplier name here from post_meta data “. Please contact us for more information.”
Thanks for any insight!
- The topic ‘Update post_content in database’ is closed to new replies.