Delete All Products ↑ Back to top
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.
Reset All Products ↑ Back to top
Somewhat related to that, below is a snippet to bulk reset Facebook data for all products :