Function to “Press Update Button” on all posts

tl;dr – I need the equivalent of pressing the “Update” button on many/all posts, without having to manually open each post and press “Update”.

I’m bulk importing from a CSV into WooCommerce, which is going fine. Everything appears to be going fine in the backend. However, things are not appearing as they should on the frontend.

On the WooCommerce “Shop” page, I have it set to display product categories. Nothing is being displayed here (I have recounted terms). The same is on the archive pages. Single product pages work as intended.

I can make them appear on the front end by going through each product, one by one, and clicking the “Update” button. That solves the issue. However, I have hundreds of products, and this is not the only import I will be doing.

I’m looking for a faster way of “clicking update”. Is there a function I can use, or a hook I can take advantage of?

I know I’ve run into a similar issue in the past with other scenarios, not just WooCommerce related. So this would be good to know for other times too.

0

Leave a Comment