How to Disable WordPress Update Notifi...
This WordPress snippet efficiently disables all update notification emails, including...

WPCodeBox
539
This snippet queries the WordPress database to find and count orphaned WooCommerce product variations, which are product variations whose main product has been deleted.
<?php
// This snippet should only run in "Manual" mode.
global $wpdb;
$orphaned_variations_results = $wpdb->get_results("SELECT * FROM {$wpdb->posts} o LEFT OUTER JOIN {$wpdb->posts} r ON o.post_parent = r.ID WHERE r.id IS null AND o.post_type = 'product_variation'");
$ov_count = count($orphaned_variations_results);
echo "There are $ov_count variations on your site.";





