1. Documentation /
  2. Change the placeholder image

Change the placeholder image

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

More info at: Configuring WooCommerce Settings.

WooCommerce 3.4x or earlier

↑ Back to top

Note: We are unable to provide support for customizations under our Support Policy. If you need to further customize a snippet, or extend its functionality, we highly recommend Codeable, or a Certified WooExpert.

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
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 . '/2012/07/thumb1.jpg';
return $src;