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
- Edit tag cloud widget number
- get product attributes for current product and store it in a variable
- Hide a menu-item and its submenus and display a ‘Log in’ link if the user is logged out
- How to get Woocommerce Variation ID? [closed]
- Handling an Ajax form submit
- Add product tag names to WooCommerce new order email subject
- How to display product cropped thumbnail (150×150) for WooCommerce product categories
- Add to checkout total lines an additional line below shipping in WooCommerce
- Unable to set right time in admin and frontend template
- How To Change The Html of Products filtration sidebar in Woocommerce?
- 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
- My Own layout in WooCommerce pages [closed]
- Woocommerce – remove product from category
- Inject PHP code into “sidebar-content” – code before my WooCommerce sidebar widget?
- Add the Name of Products Ordered to Admin New Order Email WooCommerce
- Hide post if matches current month and year
- How Display Posts on category
- get current product name in functions.php
- Get WooCommerce product details and transfer them to a custom DB table
- Woocommerce product variation backorder
- Status 400 for AJAX POST Request with admin-ajax.php
- WooCommerce Webhooks not firing because of error in wp-includes/meta.php
- Print last modified date only on posts
- WooCommerce: How can I get orders with a custom ID in order meta data object?
- remove post that has no content
- How to show only subcategories in parent category not parent category?
- How to add specific meta tags to head of cart and checkout pages in woocommerce?
- Woocommerce change prices for a certain country [closed]
- WP Insert Post and then go to post
- Extend Woocommerce Widget Class – WC_Widget_Product_Categories
- Get latest post from all categories except one
- Parse error: syntax error, unexpected end of file
- How would I use this filter to change the output of the date format to “Twitter time”?
- Load Posts on Click via Ajax into a DIV
- Remove item in Checkout
- Woocommerce – get_items() returns empty array
- Include js script ONLY on woocommerce product category pages? [closed]
- WP_Query multiple post results
- Convert Featured products loop into Recent products loop?
- form $_post action value gets truncated after it passes through two forms
- Wp Query : Order by distance lat,lon
- Woocommerce order status payment
- Dynamically added custom fields not displayed on WooCommerce email notifications
- get value from get_post_meta then reuse it in another get_post_meta
- Payment field disappears on custom Paypal plugin
- Creating a brand attribute as a variable
- WordPress Post Block Element not properly parsed with the_content filter
- How do I set a hidden field to a value?
- Build A Custom SQL Query for WordPress Search
- How to remove Login from in my account page
- WordPress Custom Form – Getting Query Vars, Weird Glitch?
- How to Send Pingbacks for all Posts in WordPress?
- I am having errors with checkout on wordpress
- Display articles with a different template in the home page | Solved |
- How can I check if a post with a particular slug or title exists?
- WordPress sorting posts by date and title using a dropdown
- Issue in displaying the ongoing event and current events in the post
- How to access specific product id on other pages/posts?
- Programmatically add a product to the cart and set price to zero when buying from certain category
- I want to show cart items number if any or nothing, simple CART text
- How to retrieve quantity input field by id in woocommerce
- Get only relevant sub-category of category “Genre” that applies to current product only
- Trying to get post ID outside loop on blog page
- Global variable doesnt’t pass to another function
- Exclude category from woocommerce product category list
- Trying to show the category of a post in the post display
- Split post or page content in two or more columns
- Edit woocommerce_product_archive_description using hook
- Possible to edit custom date field and display?
- Check the database for a postmeta field
- How to empty price of simple and variable product when product changed into out off stock
- Send POST request to Flask app from functions.php file
- How to create loop inside wordpress function?
- Send Notification after post published was working but stopped after the last WP update
- How to auto-generate random numbers in username?
- Remove generated category and tag class names from woocommerce product & blog listings markup
- How to echo a PHP code into WooCommerce variation product?
- Get Billing Email from WooCommece Checkout and Pass to Fullstory JS
- Woocommerce custom attributes list help
- How to insert text into post based on category – via single.php file
- WordPress change post date format from english to japanese
- Generate random access token to a post page
- Global filter not working
- Only display notification on single post
- WooCommerce remove_action and add_action [closed]
- Adding a number to a date
- Get posts associated with media attachment
- Passed variable gets undefined variable error on insert on next page
- Automatically create a loop for post ID
- Why does WP_Query show only the same post even with different categories and endwhile?
- How to add margin underneath woocommerce total price amount -> productpages
- Query posts by custom fields (object post)
- How to find the value of the user password in wordpress and send it to another server via rest api
- Excerpt all post content Content Same Size without word cutting off
- Woocommerce – Include custom user meta in order ‘filter by registered customer’ Ajax search
- Change WooCommerce Order status from frontend form submitted data