Fixing duplicate slug append (-2) on published WordPress pages with empty trash

WordPress appends -2 to a page slug when wp_unique_post_slug() finds another row in wp_posts with the same post_name, the same post_type, and the same post_parent, and a page in the trash still counts as a match because the check ignores post_status for everything except auto-draft, inherit, and revisions. Root Cause Diagnosis Trashed posts keep their … Read more

WooCommerce tax calculation mismatch: Inclusive vs exclusive tax on coupon discounts

WooCommerce applies coupon discounts to line-item amounts as they are stored in the product price, and when prices are entered inclusive of tax, the discount is applied to the tax-inclusive figure and the tax is then backed out of the discounted amount, which can differ by a few cents from the tax computed on an … Read more

How to bypass WordPress memory_limit hardcoded by server php.ini limits

Root Cause Diagnosis WordPress WP_MEMORY_LIMIT and WP_MAX_MEMORY_LIMIT only request a higher limit through ini_set(‘memory_limit’, …) at runtime, and that call silently fails when the server has locked the directive. The lock comes from php_admin_value[memory_limit] in a PHP-FPM pool file, php_admin_value in an Apache or OpenLiteSpeed vhost, ini_set listed in disable_functions, or Suhosin’s suhosin.memory_limit. WordPress also … Read more

Fixing Elementor Infinite Loading Wheel Caused by admin-ajax.php 403 Forbidden

Root Cause Diagnosis The Elementor editor initializes through POST requests to /wp-admin/admin-ajax.php (action=elementor_ajax), and a 403 on that request means something upstream of PHP rejected it, so the editor never receives its initialization JSON and the loading wheel never clears. The usual culprits are a WAF (ModSecurity/OWASP CRS, Cloudflare managed rules, aaPanel Nginx WAF, Wordfence) … Read more

Rank Math Primary Category Not Persisting on Bulk WooCommerce Product Import

Root Cause Diagnosis Rank Math stores the primary category as post meta (rank_math_primary_product_cat for the product_cat taxonomy), and it writes that meta only when the product edit screen is submitted with the metabox’s primary term field. The WooCommerce CSV importer, WP All Import, and other bulk tools save products through the CRUD layer (WC_Product::save()) or … Read more

WordPress site health error: Background updates not working due to version control checkout

Root Cause Diagnosis WP_Automatic_Updater::is_vcs_checkout() assumes a site containing a version control directory is a development checkout and disables automatic updates to avoid overwriting tracked files. It starts at ABSPATH (and at the plugin, theme, or language directory being updated), walks up through every parent directory to /, and looks for .git, .svn, .hg, or .bzr … Read more

WooCommerce order stock status not reducing on completed COD orders

Root Cause Diagnosis WooCommerce reduces stock through wc_maybe_reduce_stock_levels(), hooked to woocommerce_payment_complete, woocommerce_order_status_processing, woocommerce_order_status_on-hold and woocommerce_order_status_completed. The function exits silently if global stock management is off, the product has manage_stock disabled, the order’s _order_stock_reduced flag is already set, or a filter returns false. COD orders never call payment_complete(), so reduction depends entirely on the status-transition hooks … Read more

Fixing WordPress media upload error: “HTTP error” without debug logs in wp-config

Root Cause Diagnosis The “HTTP error” message is the Media Uploader’s generic fallback. It appears when the request to wp-admin/async-upload.php returns anything other than the expected JSON response: a non-200 status, a dropped connection, or a body corrupted by PHP warnings. Failures that occur before WordPress finishes loading are never written to wp-content/debug.log. These include … Read more

How to Clean Orphaned wp_postmeta Rows Safely Using Direct SQL

Root Cause Diagnosis Orphaned wp_postmeta rows are rows whose post_id no longer matches any ID in wp_posts. They accumulate because wp_postmeta has no foreign key constraint (WordPress tables on MySQL/MariaDB use InnoDB without declared relationships), so any deletion that bypasses wp_delete_post() leaves the meta behind. Typical sources are direct SQL deletes of posts, plugin uninstalls … Read more

Resolving mixed content HTTP warnings on WooCommerce SVG icons behind Cloudflare SSL

Root Cause Diagnosis WooCommerce builds SVG icon URLs (payment icons, cart and checkout block assets, theme sprites) with plugins_url(), WC()->plugin_url(), and get_template_directory_uri(), which choose http:// or https:// based on is_ssl(). With Cloudflare SSL mode set to Flexible, the visitor connects over HTTPS but Cloudflare fetches from the origin over plain HTTP, so PHP sees no … Read more