The "Order Notes" text area on the checkout screen is a crucial field where buyers leave essential instructions, such as door codes or delivery drop preferences. A costly database bug can cause these messages to vanish entirely. The client types their instructions, completes the payment, but when the admin reviews the order in the dashboard, the note section is completely empty, leading to major logistical delays and customer complaints.

This issue stems from a structural saving failure within the checkout AJAX database pipeline. WooCommerce processes order notes differently from standard checkout billing metadata fields; it stores them as specialized post comments under the comment_type = 'order_note' classification. If your site utilizes security plugins that block internal admin-ajax.php comment submissions, or if database tables (wp_comments) are fragmented after an improper migration, the script silently discards the user-written message without notifying the buyer.

The Solution

Fixing missing order notes requires re-routing the note save routine directly into the core order creation metadata pipeline.

  1. Optimize Comment Database Indexing: Access your database management panel (phpMyAdmin), select the wp_comments table, navigate to the maintenance utilities tab, and execute a Repair Table and Optimize Table command pass.

  2. Inject a Direct Metadata Failsafe Hook: Add this custom PHP code snippet to your child theme's functions.php file to intercept the data submission and guarantee the note is saved directly as hard order metadata if the comment loop fails:

PHP
 
add_action('woocommerce_checkout_update_order_meta', 'backup_order_notes_to_metadata', 10, 2);
function backup_order_notes_to_metadata($order_id, $data) {
    if (!empty($_POST['order_comments'])) {
        update_post_meta($order_id, '_customer_order_note_backup', sanitize_textarea_field($_POST['order_comments']));
    }
}
  1. Deactivate Security POST Filtering: Ensure security firewalls (such as Cloudflare or Wordfence) are not scrubbing out form field data containing special punctuation symbols like pound signs (#) or slashes (/), which customers commonly use in delivery instructions.