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 🙁
Related Posts:
- WP_Query on custom post type not displaying, multiple loops & get_template_part
- Using new WP_Query in shortcode in a custom field causes the main post content to not display
- wp_query to find posts by year and month
- Two near-identical custom field types – one works, the other doesn’t . What can cause this?
- Having Issue on Ordering CPT by Custom Field In Custom WP Query
- How do I list a custom field and custom taxonomies for each result in a loop?
- Custom meta fields not showing up in WP_Response Object via custom endpoint
- sorting in wp query based on custom field value
- WordPress query in which condition uses custom field
- WordPress loop add heading before first of type
- How to make a shortcode for my WP_Query Loop? [duplicate]
- Error in WP Query. If variable is empty it is displaying previous post value
- Can I create a loop with multiple post types and specify different $args for each post type?
- Display CPT posts based on specific taxonomy
- WP_Query: include custom post type only with specific meta value
- WordPress custom loop filter by meta_key and value with serialize data
- Returning a list of custom post types excluding those without a specific meta_value
- How to make sure content doesn’t display if selection is empty
- Show one item per category of a custom post type
- Meta Key Value in current-user-only loop
- Calculate all custom field values in the post loop
- wp_query check if integer exists in custom field’s array
- Custom loop with multiple taxonomy queries
- What is the recommended / best way to do this: Event calendar post/type in a block-based theme?
- How can I get the number of custom post type posts that have a specific attachment image set?
- Problem querying Custom post type by custom fields
- Orderby CPT custom fields not working
- WP_Query order by custom field, then randomly order some of results
- Query custom post type with ACF Date
- Store CPT ‘Reviews’ average ratings to a WordPress DB table or to a DB custom table?
- Including metaboxes from custom post types in global search — continued
- Query Multiple Custom Posts by Custom Fields
- What’s the WP way to load remaining custom posts?
- Get Posts by multiple custom fields is not working
- WP Query with categories only shows one post and ignores the category
- Order Custom Post Type by Custom Field Value
- Problem: wp_query outputs all images on site
- First custom field value (out of several) displayed twice after query
- Possible to filter custom post type with multiple meta data?
- pagination not working for category.php (custom post types in categories)
- Query based on custom fields start and end date
- Wrapping x posts in html without leaving empty html
- WP Query post__in not returning correct results
- Sort posts in loop by the WooCommerce Membership of the author
- DIsplaying URL of custom field in last post of certain taxonomy && post type
- How can I group posts by months and years?
- Multiple Custom Post Type queries, how to DRY it up
- Custon Content within WordPress Loop
- Loop increase number
- WP Query ‘posts_per_page’
- Using wp_query to modify the loop in index.php for a CPT
- Display post from a date range from custom field
- Custom WP_Query doesn’t display all posts
- Query & the_content() is showing in the header
- post_per_page ignored in WP_Query
- How to get specific post meta by title or id
- get_pagination not working on a custom post type query (using WP_Query)
- WP_Query with custom post type ID
- Getting a custom post’s custom field based on another custom post’s custom field select
- How to conditionally add Custom Post Type to Front Page
- hide specific div on single.php [closed]
- WP_Query orderby not work with meta_key
- Pagination not working on custom query on a page
- How do you output an unknown number of images in a custom post type with desired markup?
- Get data from PHP to JavaScript to set position of each post on front page
- display posts of custom post type with custom taxonomy
- Display custom post type for specific user
- Get post content from another section in custom single page
- Custom Post type loop with ACF not displaying properly
- Trying to add a class to post links
- postsperpage value not being applied
- Group by custom field value (start and end times)
- Display the current post in browser as the first post in a loop (for a slideshow)
- Display post from custom post type
- List all Custom Post Type posts excluding certain Taxnomy term
- foreach loop inside the loop creating duplicates in output
- How to retrive Custom Post Type Meta Fields in Custom WP_Query
- Displaying information from custom field on custom post type
- How to fetch posts that are stored in the different table than (default) wp_posts?
- Cant’ Display Custom Post Type Title Base on Tax Terms
- Cache issue with WP_Query and custom field filtering
- Get post-meta value of all custom-posts – lowest to highest year-count?
- Loop for custom-post-type comparing taxonomy terms for “related” posts?
- Custom PT, Taxonomys and wordpress query
- Displaying Posts Using a Custom Query with a Custom Field and a term_id
- How can i loop through custom post type according to custom meta field?
- Custom Post Type Query W/Category Dropdown
- Multiple custom post type queries causing wrong post types to be grabbed in taxonomy + single templates?
- Custom post type pagination error
- Query for specific taxonomy that executes a particular loop depending on volume of posts?
- What is the most efficient way to execute recursive complex queries?
- WP query_posts group by meta field related
- Page that lists publications by classifying them by taxonomy
- How to sort WP_Query by a custom text field (written as a date dd/mm/yyyy)
- posts_per_page in custom WP_Query does not override “Reading” settings?
- Custom Form / Search with Custom Post Type Data
- Create if else for post types in WP_Query ‘post__in’ values
- WP Query from two Custom Post type fields as statement
- Alike Shortcode using in Custom Shortcode
- Query custom post type that has a serialized relational advanced custom field value