0

the problem

I'm trying to translate a wordpress 4.7. But the site was consived in spanish and just now I installed the WPML plugin, now after 5000 post uploaded.

I am using the visual composer and custom fields for all the structure of the content.

for some reason, when I go the english view, all my custom fields didn't appear. That is because when it was created all that field wasnt set to be translated. So I go back to the WPML configurations and configure to copy some of them from spanish to english, and some other set to be translated.

Going back to the post, nothing change, I have to update my content to see the change implemented, So I dont want to do that for all my 5000 posts.

The solution

There is a wordpress function called: wp update post

 <?php wp_update_post( $post, $wp_error ); ?> 

I want to know how can I use that function and update all my 5000 posts?.

Any idea?

  • get_posts(), ten loop over them. Not sure what your problem is. Can you try to explain it again? – cybmeta Jun 6 '18 at 8:38
  • I want to update all my posts. In a concrete moment, not when I go into an specific page. Maybe it could run by the cron – ValRob Jun 6 '18 at 8:55

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.