Note: We are unable to provide support for customizations under our Support Policy. If you need to further customize a snippet, or extend its functionality, we highly recommend Codeable, or a Certified WooExpert.
Occasionally deleting all products from the Facebook catalog and then letting things sync again is the only way to fix strange issues.
The following code snippet can be used to delete all products in bulk:
This snippet is designed to continue running even if it encounters a timeout by doing batches of 500 products at a time. While you usually won’t run into a timeout, if you have thousands and thousands of products in your store, you may want to be aware that the admin area might time out a few times leading to a white screen right after you install the snippet. Don’t worry! Keep refreshing the page until the admin is back up, at which point all products will have been processed. It’s important to note that the snippet only runs when someone loads an admin page so it won’t affect any customers browsing the site. 🙂
The snippet is smart in that it runs only once so it’s not a big deal if you leave it around, but it’s always good to remove unused code. If the snippet doesn’t work, however, triggering it again requires updating the option name in the code snippet or deleting the option the snippet stored in the first place.
Somewhat related to that, below is a snippet to bulk reset Facebook data for all products :
The script above only helps with deleting all products published in your WooCommerce store from the Facebook catalog. In cases where the products are entirely deleted (programmatically deleted, for example), some orphan products will remain on the FB catalog.
To delete a catalog, please follow the steps below:
- Go to Commerce Manager.
- In the “Catalogues” section, click on “Manage list”
- Select the catalog that you want to delete.
- Click on the “Delete” button then confirm by clicking “Delete”
You’ve deleted your catalog.