Link to home
Start Free TrialLog in
Avatar of John H
John HFlag for United States of America

asked on

Wordpress - Updating All Posts on Website

Hi folks,

I'm in a bit of a pickle here.  Bottom line, I have a wordpress site and need to update ALL posts on my large site somehow ( something that accomplishes hitting the "update" button within the edit post dashboard (in order to add  a value to a newly added field to the database) . My only guesses are to do it programatically, or wondering if importing a copy of the database might accomplish this (doubtful).  I've scoured the web for this, but the code I've found breaks my site.

To explain why I'm in this situation, I have a custom field that will not register to postmeta in order so that it shows in a json output for a post via the wp Rest Api.

My workaround for exposing these fields to json was to install Advanced Custom Fields plugin and create a copy of the existing custom fields.  If i update a post manually, the new field is visible in a json request (awesome!), but it requires me to update ALL posts to get the json output for that field in every post.

Clear as mud!?

Thanks for any assistance!
Avatar of John H
John H
Flag of United States of America image

ASKER

Actually, this is looking more like a mysql databate update operation, as opposed to a new function (or similar).

Currently trying to download a csv file of the custom post type what needs the new field updated, then upload that file back up and see what happens.
ASKER CERTIFIED SOLUTION
Avatar of Mike Lazarus
Mike Lazarus
Flag of Australia image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of John H

ASKER

Hi Mike - this ended up being the solution I used - thank you!