Skip to content

Snippet: Alter WooCommerce Placeholder Image HTML

The following snippet allows you to override the default placeholder image HTML output for your main shop page and archives. If all you want to do is change the default placeholder image (not the full html) you can do this in the WooCommerce settings under Products > Placeholder image.

function my_woo_placeholder_img_html( $html ) {
    $html = 'YOUR CUSTOM PLACEHOLDER IMAGE HTML';
    return $html;
}
add_filter( 'wpex_woo_placeholder_img_html', 'my_woo_placeholder_img_html' );
All PHP snippets should be added via child theme's functions.php file or via a plugin. We recommend Code Snippets (100% Free) or WPCode (sponsored)
Back To Top