WP_Query orderby modified to include custom meta changes

Looks like I was on the right track.

using update_post_meta does not update the modified date of a post, so what you have to do is update the content of the post.

Luckily for me, I was not using the content, only custom meta. So updating the content with a random string whenever I updated post meta works. If you are using the content as well, then maybe updating the content with the same value will work as well (as in WordPress does not check to see if the content actually changed when marking as modified).

For those wondering, here is the code to update post content.

$my_post = array(
    'ID'           => $postID,
    'post_title'   => 'title of the post',
    'post_content' => 'content of the post',
);

// Update the post into the database
wp_update_post( $my_post ); 

I hope this helps someone else, as I think it’s silly that updating meta values does not count towards post modify date 🙁