How to Change product’s default placeholder image to custom image

The placeholder image can now be set at: WooCommerce > Settings > Products as of version 3.5x.

WooCommerce 3.4x or earlier

To Change product’s default placeholder image to custom image Use Below Code

Add code to your child theme’s functions.php file or via a plugin that allows custom functions to be added, such as the Code snippets plugin. Avoid adding custom code directly to your parent theme’s functions.php file as this will be wiped entirely when you update the theme.

/**
 * Change the placeholder image for all products (globally)
 */
add_filter('woocommerce_placeholder_img_src', 'custom_woocommerce_placeholder_img_src');

function custom_woocommerce_placeholder_img_src( $src ) {
	$upload_dir = wp_upload_dir();
	$uploads = untrailingslashit( $upload_dir['baseurl'] );
	// replace with path to your image
	$src = $uploads . '/2025/04/product--custom-placeholder.webp';
	 
	return $src;
}

Comments

No comments yet. Why don’t you start the discussion?

Leave a Reply

Your email address will not be published. Required fields are marked *