Support

Account

Home Forums General Issues Order by true/false field using WP_Query Reply To: Order by true/false field using WP_Query

  • if anyone is searching for a solution to this issue, i had 2000 posts and found a way.

    just write a php script that loads wp (outside of wp theme folder).
    it should first go through groups of posts if you have to many (say grouping of 50). i did it with a url start stop var ?start=0&stop=100

    you can first load the post, take the title into a var

    then update the post using wp_update_post and the title from the var

    https://codex.wordpress.org/Function_Reference/wp_update_post

    it took about 10 mins to update all 2000 after each load and changing the start stop and because i am force saving the post, the acf default values for some fields were generated and saved.

    plus this was with wpml translated posts as well, so it was about 3800 as some translations were missing.