Skip to content

Instantly share code, notes, and snippets.

View anton-roos's full-sized avatar
🎯
Focusing

Anton Roos anton-roos

🎯
Focusing
View GitHub Profile
@anton-roos
anton-roos / sendy.sql
Last active April 9, 2020 10:18
Sendy SQL Queries
/* Delete all bounced email addresses from list 13 */
DELETE FROM `subscribers` WHERE `bounced` = 1 AND `list` = 13;
/* Delete all marked as spam email addresses from list 5 */
DELETE FROM `subscribers` WHERE `complaint` = 1 AND `list` = 5;
@anton-roos
anton-roos / footer.html
Last active May 25, 2020 14:49
Changing footer year with JavaScript Avada
@anton-roos
anton-roos / update-text.sql
Last active May 25, 2020 15:03
Update text in WooCommerce Database
UPDATE `wp_cf7dbplugin_submits`
SET `field_name` = REPLACE(`field_name`, 'tel-123', 'tel-576')
WHERE `field_name` LIKE 'tel-123%';
@anton-roos
anton-roos / update-manage-stock.sql
Last active May 25, 2020 14:48
Updtate all WooCommerce Products to "Mange Stock"
UPDATE `wp_postmeta`
SET `meta_value` = 'yes'
WHERE `meta_key` = '_manage_stock'
@anton-roos
anton-roos / update-sold-individually.sql
Last active May 25, 2020 14:47
Update Sold Individually of all WooCommerce products.
UPDATE `wp_postmeta`
SET `meta_value` = 'no'
WHERE `meta_key` = '_sold_individually'
@anton-roos
anton-roos / select-duplicate-skus.sql
Last active May 25, 2020 14:41
Select duplicate SKUs from WooCommerce database.
SELECT meta_value
FROM wp_postmeta
WHERE meta_key = '_sku'
AND meta_value != ''
GROUP BY meta_value HAVING COUNT(meta_value) > 1
@anton-roos
anton-roos / count-duplicate-skus.sql
Created May 25, 2020 14:51
Count duplicate WooCommerce Products SKUs
SELECT `meta_value`, `meta_key`, count(*)
FROM wp_postmeta WHERE meta_key LIKE '_sku'
GROUP BY `meta_value`
ORDER BY `count(*)` DESC
@anton-roos
anton-roos / select-products-no-featured-image.sql
Created May 25, 2020 14:53
Select WordPress Posts or WooCommerce Products with no featured image.
@anton-roos
anton-roos / update-stock-status.sql
Created May 25, 2020 14:56
Update stock status of WooCommerce products.
UPDATE wp_postmeta
SET `meta_value` = 'outofstock'
WHERE `meta_value` = 'instock'
AND `meta_key` = '_stock_status'
@anton-roos
anton-roos / latest-commit-by-branch.sh
Created June 10, 2020 10:14
Get all latest commits per branch sort by latest commit after git pull.
git pull
echo "Git pull done, fetching timetable..."
for branch
in `git branch -r | grep -v HEAD`;do echo -e `git show --format="%ci %cr" $branch | head -n 1` \\t$branch;
done | sort -r