WooCommerce seems to update the ‘last modified’ value of a product on every change. If you want to take a look at the source code, go to woocommerce\includes\data-stores\class-wc-product-data-store-cpt.php and check the function update.
This solution seems to work, however it could be improved to make sure it doesn’t mess up with anything else. Basically checks if the request has info of a comment and filters the query that modifies the post date to skip it. I didn’t find any earlier hook than the query filter.
add_filter('query', function($query){
if(isset($_POST['comment']) && strpos($query, 'post_modified')){
return '';
}
return $query;
});
Related Posts:
- How can I use wp_query to show all product data using just the products ID?
- Woocommerce Custom Meta Boxes- How to only display if they actually have content
- If Post Published Date or Modified Date is 1 Year or Older, Display Notice on Post Page
- How to change post date and post time in WordPress automatically with a function
- Calculate business days
- How to add product in woocommerce with php code [closed]
- How to update custom fields using the wp_insert_post() function?
- the_date() not working
- How to correctly add Javascript in functions.php
- How to check if a plugin (WooCommerce) is active?
- How to trigger WooCommerce order complete email?
- How to check if woocommerce is activated in theme
- Disable Attachment Pages Completely
- How to get Woocommerce order product info
- Inject post (from specific category) between posts in Loop
- Woocommerce get selected shipping zone id for the current user
- Edit tag cloud widget number
- How to add date range in woocommerce with code
- Remove option to allow trackbacks/pingbacks from post page options
- How to automatically apply woocommerce product title to all product images alt tags?
- Remove Woocommerce product link
- Query WooCommerce orders grouped by several order statuses
- Creating custom Woocommerce attribute taxonomies from a plugin
- get product attributes for current product and store it in a variable
- Display posts by month
- Custom SQL query to get List of posts with featured image url
- Display sorting options dropdown when using WooCommerce product category shortcode
- Alter query on edit.php
- Permanently remove first image from posts
- retrieve thumbnail from post ID of best selling product in category
- Display a selected custom product option in WooCommerce cart
- How to get year, month and hour in WordPress?
- How to have a custom display for both woocommerce archive and product-category pages? [closed]
- WooCommerce: How to display item meta data in email confirmation using woocommerce_order_item_meta_end
- How to get the original price of the product in woocommerce?
- Woocommerce auto cancel On-Hold after X days
- Handling error states with admin_post
- How to change “Shipping Calculator “field label on Cart Page – woocommerce? [closed]
- How to remove “out of stock” variation options from size dropdown in woocommerce?
- WP_Query | Help me create a search term with an ‘OR’ relation?
- Archive listing of posts by publish year (multiple years)
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- Using Cookie Data For WP_Query Loop
- WooCommerce – Customer Order History Pagination
- How to get Woocommerce Variation ID? [closed]
- Cleanest/Fastest way to avoid calling and retrieving data from the database multiple times?
- Automatically check the option “Enable stock management at product level” on product creation
- get_the_content if it contains multiple lines it results in SyntaxError
- The values of custom fields are not available functions.php
- How to show order data by multiple ID?
- Looking to exclude blog posts from category Previous/Next buttons
- Use wc_enqueue_js only on specific pages – nested add_action
- How to Remove a Filter from the Admin List Table?
- Insert code when users come from an specific referer
- WordPress returns a wrong date
- Handling an Ajax form submit
- Automatic Excerpt Not Working
- How to display related posts from parent category
- Problem with Woocommerce REST API Authentication
- Woocommerce: How to override core functions in functions.php?
- Woocommerce, recognize the loop of related products
- Disable External Pingacks on WordPress Posts and Only Allow ‘Self Pings’
- Replace existing content from specific WooCommerce admin orders list column
- Remove commas from WooCommerce checkout addresses fields
- Add product tag names to WooCommerce new order email subject
- Using a javascript file to access a get posts array
- WooCommerce Link to Product Category
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- Remove General Tab and Plugin Tab in Settings in Woocommerce
- Get WooCommerce shipping methods programmatically
- WooCommerce – Display variation custom field value [closed]
- How to display product cropped thumbnail (150×150) for WooCommerce product categories
- Add a custom text field to WooCommerce admin product data “Variations”
- Add to checkout total lines an additional line below shipping in WooCommerce
- Woocommerce – How to get products which have a sale between 20% to 40%? [closed]
- Translating add to cart woocommerce button [closed]
- Unable to set right time in admin and frontend template
- New Plugin Review
- Output a WooCommerce product custom field in WooCommerce using get_post_meta()
- Append a term to WooCommerce product existing product category terms
- Woocommerce: Is it possible to overide the settings for allowing to purchase out of stock products [closed]
- Make custom field meta not display if there is not data in it
- WP_Query meta_query results date by date
- Woocommerce HTML email option unavailable
- Print number of post (in reverse)
- Use template for posts with a particular category grandparent
- Count number of published posts by type
- WP Insert Post function – Insert Post Thumbnail
- using woocommerce_template_single_add_to_cart in shop-loop – javascript issues [closed]
- How to add SVG icon above product tab title
- How does WooCommerce ensure that a product doesn’t run out of stock during payment? [closed]
- How To Change The Html of Products filtration sidebar in Woocommerce?
- Display related products with custom output
- How To add custom radio boxes to WooCommerce Billing page and change total price by this field?
- WooCommerce: update custom fields after checkout validation failure
- Add attribute / custom attribute to product in woocommerce
- Trigger Woocommerce New User Email
- Listing and displaying WooCommerce Shipping Zones in the frontend? [closed]
- Automatically generate Post/Page from searched Database item?
- Woocommerce filter cart and category specific quantity [closed]