Created
February 26, 2025 21:53
-
-
Save szepeviktor/07743e9999290fae083bf35c99ca6472 to your computer and use it in GitHub Desktop.
Dump WooCommerce product attributes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
DUMP_FILE="/home/user/product-attr-debug/$(date --utc +%F).product" | |
TOTAL="$(wp wc product list --format=count)" | |
for PAGE in $(seq 1 $(( (TOTAL+99) / 100 ))); do | |
wp wc product list --page=${PAGE} --fields=id,attributes >>"${DUMP_FILE}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This could be a daily cron job to monitor changes in product attributes.